Skip to content

chore: update dependency #124

chore: update dependency

chore: update dependency #124

Workflow file for this run

name: Publish Docker image
on:
release:
types: [ published ]
push:
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yml"
permissions: write-all
jobs:
build:
strategy:
matrix:
build_tag: [ full, tun ]
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# https://github.com/docker/metadata-action
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
mythologyli/zju-connect
tags: |
type=schedule
type=ref,event=branch
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
type=sha
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
# https://github.com/docker/build-push-action
- name: Build and push full version
if: ${{ matrix.build_tag == 'full' }}
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
build_tag=${{ matrix.build_tag }}
- name: Bulid and push not full version
if: ${{ matrix.build_tag != 'full' }}
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}-${{ matrix.build_tag }}
labels: ${{ steps.meta.outputs.labels }}-${{ matrix.build_tag }}
build-args: |
build_tag=${{ matrix.build_tag }}