This commit is contained in:
System Scribe 2023-10-10 13:27:36 +00:00 committed by GitHub
commit d1cce63b7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

55
.github/workflow/main.yml vendored Normal file
View file

@ -0,0 +1,55 @@
name: CI Build and Upload
on:
pull_request:
types:
- closed
jobs:
build-and-upload:
runs-on: self-hosted
steps:
- name: Check PR label
id: check_label
uses: actions/labeler@v2
with:
action: contains
label: CI:TriggerBuild
- name: Tag with Branch
id: image_tag
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Check repository
id: check_repo
run: echo "::set-output name=repo::${{ github.event.pull_request.base.repo.name }}"
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Checkout code
uses: actions/checkout@v2
- name: Build Docker image
id: build-image
run: |
docker buildx build -t my-golang-app .
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/386
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/go-ethereum:${{ env.BRANCH }}
build-args: |
BRANCH=${{ env.BRANCH }}