submit code #28
Workflow file for this run
This file contains hidden or 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 | |
on: | |
pull_request: | |
branches: ["develop", "main"] | |
push: | |
tags: ["*"] | |
branches: ["develop", "main"] | |
jobs: | |
build-and-deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest-8c32g | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Docker login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.QUAY_IO_BOT_USERNAME }} | |
password: ${{ secrets.QUAY_IO_BOT_PASSWORD }} | |
registry: quay.io | |
- uses: olegtarasov/[email protected] | |
id: tag-name | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 7 | |
- name: Setup Golang with cache | |
uses: magnetikonline/action-golang-cache@v4 | |
with: | |
go-version-file: go.mod | |
- name: download server package | |
run: go mod download -x | |
- name: Test | |
run: | | |
go test -v ./... | |
- name: build server | |
run: make build | |
- name: Build and publish tag docker image | |
uses: docker/build-push-action@v3 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: quay.io/subscan-explorer/solidity-verification-tool:${{ env.GIT_TAG_NAME }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Build and publish SHA docker image | |
uses: docker/build-push-action@v3 | |
if: startsWith(github.ref, 'refs/tags/') == false | |
with: | |
context: . | |
push: true | |
tags: quay.io/subscan-explorer/solidity-verification-tool:sha-${{ env.SHA }}-${{ github.run_number }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- uses: 8398a7/action-slack@v3 | |
if: failure() | |
with: | |
status: ${{ job.status }} | |
fields: repo,author,eventName,workflow,ref,commit | |
channel: ${{ secrets.SLACK_CHANNEL_ID }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} |