Skip to content

Commit

Permalink
Created linktoqr_ci_in_selfhosted_runner.yml (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
chefgs authored Feb 16, 2024
1 parent 5cafa86 commit a6c8ab4
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/linktoqr_ci_in_selfhosted_runner.yml
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

0 comments on commit a6c8ab4

Please sign in to comment.