Skip to content

Merge pull request #209 from LunNova/renovate/docker-build-push-actio… #105

Merge pull request #209 from LunNova/renovate/docker-build-push-actio…

Merge pull request #209 from LunNova/renovate/docker-build-push-actio… #105

Workflow file for this run

name: Docker push
permissions:
contents: read
packages: write
on:
push:
branches: [ main, dev ]
tags: [ 'v*' ]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set tag var
id: tagvars
run: |
GITHUB_REF_STRIPPED=${GITHUB_REF#refs/*/}
echo ::set-output name=tag::${GITHUB_REF_STRIPPED}
- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
- name: Cache Docker layers
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@1a162644f9a7e87d8f4b053101d1d9a712edc18c # v6.3.0
with:
push: true
tags: ghcr.io/lunnova/no-more-mr-dice-guy:${{ steps.tagvars.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache