mirror of
https://github.com/rangermix/TwitchDropsMiner.git
synced 2026-05-30 08:59:36 +00:00
refactor: update Docker workflow for build validation and remove unnecessary steps
This commit is contained in:
36
.github/workflows/docker.yml
vendored
36
.github/workflows/docker.yml
vendored
@@ -10,9 +10,8 @@ on:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Docker Dev Build & Push
|
||||
name: Docker Build Validation
|
||||
runs-on: ubuntu-latest
|
||||
environment: prod
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -20,43 +19,14 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up variables
|
||||
id: vars
|
||||
run: |
|
||||
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
|
||||
echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: rangermix/twitch-drops-miner
|
||||
tags: |
|
||||
type=raw,value=dev
|
||||
type=raw,value=dev-${{steps.vars.outputs.sha_short}}
|
||||
type=raw,value=latest,enable=${{github.ref == 'refs/heads/master'}}
|
||||
type=sha,prefix=
|
||||
|
||||
- name: Build and push Docker image
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{steps.meta.outputs.tags}}
|
||||
labels: ${{steps.meta.outputs.labels}}
|
||||
push: false
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
build-args: |
|
||||
BUILD_DATE=${{steps.vars.outputs.date}}
|
||||
VCS_REF=${{github.sha}}
|
||||
VERSION=dev-${{steps.vars.outputs.sha_short}}
|
||||
|
||||
Reference in New Issue
Block a user