mirror of
https://github.com/dockur/windows.git
synced 2025-12-16 04:03:04 +00:00
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
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
|