Add gha caching #162
Workflow file for this run
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: 'ci' | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
pull_request: | |
types: [opened, reopened, synchronize] | |
permissions: | |
id-token: write # Important for at least docker gha cache | |
contents: read | |
jobs: | |
dagger: | |
runs-on: ubuntu-latest | |
services: | |
argocd-redis: | |
image: redis | |
ports: | |
- "6379:6379" | |
# Set health checks to wait until redis has started | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.20' | |
- | |
name: Install | |
run: go get dagger.io/dagger@latest | |
- | |
name: Release and deploy with Dagger | |
run: | | |
export ACTIONS_RUNTIME_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN | |
export ACTIONS_CACHE_URL=$ACTIONS_ID_TOKEN_REQUEST_URL | |
export _EXPERIMENTAL_DAGGER_CACHE_CONFIG="type=gha,mode=max,url=$ACTIONS_CACHE_URL,token=$ACTIONS_RUNTIME_TOKEN" | |
go run ci/main.go | |
env: | |
REGISTRY_PASSWORD: '${{ secrets.REGISTRY_PASSWORD }}' | |
REGISTRY_USER: '${{ secrets.REGISTRY_USER }}' | |
GITHUB_ACCESS_TOKEN: '${{ secrets.GH_ACCESS_TOKEN }}' | |
REGISTRY_URL: '${{ secrets.REGISTRY_URL }}' | |