Update alpine:3.19 Docker digest to 6380aa6 #191
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker image | |
on: | |
push: | |
pull_request: | |
jobs: | |
ci: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract tags | |
shell: bash | |
run: | | |
branch_name=${GITHUB_REF#refs/heads/} | |
tags=henrist/zerotier-one | |
if [ "$branch_name" = "master" ]; then | |
major_minor=$(grep ZEROTIER_VERSION= Dockerfile | sed -r 's/.+=([0-9]+\.[0-9]+)\..+/\1/') | |
tags=henrist/zerotier-one:latest,henrist/zerotier-one:$major_minor | |
elif [ "$branch_name" = "next" ]; then | |
tags=henrist/zerotier-one:next | |
fi | |
echo "##[set-output name=tags;]$(echo "$tags")" | |
id: extract_tags | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' }} | |
tags: ${{ steps.extract_tags.outputs.tags }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |