Merge pull request #91 from topfreegames/fix_cross_account_amis #450
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: Go | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ main ] | |
jobs: | |
lint: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21.9 | |
- name: Run lint | |
uses: golangci/[email protected] | |
with: | |
version: latest | |
args: --timeout 10m0s | |
tests: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22.5 | |
- name: Install dependencies | |
run: sudo apt install make -y | |
- name: Run tests | |
run: make test-ci | |
docker-image: | |
runs-on: self-hosted | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: | |
- tests | |
- lint | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: tfgco/${{ github.event.repository.name }} | |
- name: Build and Push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
tfgco/${{ github.event.repository.name }}:latest | |
labels: ${{ steps.meta.outputs.labels }} |