chore: upgrade to golang 1.23 and update dependency #131
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: Publish Docker image | |
on: | |
release: | |
types: [ published ] | |
push: | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/*.yml" | |
- "Dockerfile" | |
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 }} |