ident yaml #30
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: 🚀 Publish | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.19 | |
- name: ⬇️ Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 5 | |
- name: Version | |
id: version | |
run: | | |
if [[ $GITHUB_REF == refs/tags/* ]] | |
then | |
tag=${GITHUB_REF##refs/tags/} | |
v=${tag##yaml-generator-app-} | |
echo "::set-output name=version::$v" | |
else | |
echo "::set-output name=version::$GITHUB_SHA" | |
fi | |
- name: Build | |
run: make build-yaml-generator-app | |
- name: Dist | |
run: make dist-yaml-generator-app | |
env: | |
VERSION: ${{ steps.version.outputs.version }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.PAT }} # `PAT` is a secret that contains your Personal Access Token with `write:packages` scope | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
ghcr.io/gimlet-io/yaml-generator-app:${{ steps.version.outputs.version }} | |
- name: 🚀 Notify Gimlet about new version | |
uses: gimlet-io/[email protected] | |
env: | |
GIMLET_SERVER: ${{ secrets.GIMLET_SERVER }} | |
GIMLET_TOKEN: ${{ secrets.GIMLET_TOKEN }} |