Merge pull request #12 from ozangoktan/patch-1 #16
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: Docker Image CI ARM64 | |
on: | |
push: | |
branches: | |
- "master" | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
jobs: | |
docker: | |
runs-on: ARM64 | |
steps: | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: softethervpn/vpnserver-arm64 | |
tags: | | |
# set latest tag for default branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
#context: "{{defaultContext}}:build" #might be used later if Dockerfile is somewhere else | |
file: ./Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
platforms: linux/arm64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |