update golang version 1.20 #15
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: CI | |
# 在master分支发生push事件时触发。 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: GoModules | |
run: go env -w GO111MODULE=on | |
- name: tidy | |
run: go mod tidy | |
- name: run main.go | |
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build src/main.go | |
- name: BuildDockerImage | |
run: docker build . --file Dockerfile --tag chinaarjun/devtools:${{ github.ref_name }} | |
- name: Publish to Registry | |
uses: elgohr/Publish-Docker-Github-Action@v4 | |
with: | |
name: chinaarjun/devtools:${{ github.ref_name }} | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
snapshot: true |