mirror of
https://github.com/dockur/windows.git
synced 2026-02-04 07:59:43 +00:00
chore: update gh actions to publish to docker
This commit is contained in:
parent
a01e6479b6
commit
d872b73f57
9 changed files with 53 additions and 221 deletions
53
.github/workflows/publish-docker.yml
vendored
Normal file
53
.github/workflows/publish-docker.yml
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
name: Docker Build and Push
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
uses: ./.github/workflows/check.yml
|
||||
build-and-push:
|
||||
needs: shellcheck
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write
|
||||
packages: write
|
||||
contents: read
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login into Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
-
|
||||
name: Extract version from release
|
||||
id: version_tag
|
||||
run: |
|
||||
# Extract the version from the release tag, removing any 'v' prefix
|
||||
VERSION_TAG="${GITHUB_REF#refs/tags/}"
|
||||
CLEAN_VERSION=$(echo "$VERSION_TAG" | sed 's/^v//')
|
||||
echo "##[set-output name=version;]${CLEAN_VERSION}"
|
||||
-
|
||||
name: Build and push version tag
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKER_USERNAME }}/windows-local:${{ steps.version_tag.outputs.version }}
|
||||
-
|
||||
name: Build and push latest tag
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKER_USERNAME }}/windows-local:latest
|
||||
Loading…
Add table
Add a link
Reference in a new issue