-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created linktoqr_ci_in_selfhosted_runner.yml (#15)
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Selfhosted Runner Link-to-QR CI | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
jobs: | ||
|
||
go_ci_job: | ||
name: Go CI Job | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Go CI code Lint | ||
uses: golangci/golangci-lint-action@v3 | ||
|
||
- name: Go CI code Unit Test | ||
run: go test -v ./... | ||
|
||
- name: Run Go Build | ||
run: go build -v ./... | ||
|
||
- name: Setup docker | ||
uses: docker/[email protected] | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ secrets.DOCKERHUB_USERNAME }}/linktoqr | ||
|
||
- name: Docker Build and Push | ||
uses: docker/[email protected] | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/linktoqr:latest | ||
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/linktoqr:latest, ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
# List of target platforms for build | ||
platforms: linux/amd64,linux/arm64,linux/arm/v8 |