Skip to content

Move to newer GitHub push action #22

Move to newer GitHub push action

Move to newer GitHub push action #22

name: Build and push
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Save image build info
run: |
docker pull alpine:3.19
docker images --format '{{.ID}}' alpine:3.19 > .github/docker-image-built-against
git ls-remote https://github.com/samhocevar/rinetd.git main > .github/docker-rinetd-built-against
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20
with:
driver-opts: 'image=moby/buildkit:v0.10.5'
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
ghcr.io/digitallyrefined/docker-wireguard-tunnel:latest
ghcr.io/digitallyrefined/docker-wireguard-tunnel:v3
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update image built against version