Skip to content

feat: allow for configurable ignore paths (#33) #20

feat: allow for configurable ignore paths (#33)

feat: allow for configurable ignore paths (#33) #20

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
permissions:
# Required to publish a release
contents: write
# Necessary to push docker images to ghcr.io.
packages: write
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
id-token: write
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Build and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Echo Go Cache Paths
id: go-cache-paths
run: |
echo "GOCACHE=$(go env GOCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
echo "GOMODCACHE=$(go env GOMODCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
- name: Go Build Cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}
- uses: actions/setup-go@v3
with:
go-version: "~1.20"
- name: Build
run: ./scripts/build.sh
- name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push
run: |
VERSION=$(./scripts/version.sh)
BASE=ghcr.io/coder/envbuilder
IMAGE=$BASE:$VERSION
docker tag envbuilder:latest $IMAGE
docker tag envbuilder:latest $BASE:latest
docker push $IMAGE
docker push $BASE:latest