This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
fix: include quarto description in product area view #534
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: "Build and deploy" | |
on: [workflow_dispatch, push] | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
RESOURCE: .nais/nais.yaml | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
image: ${{ steps.image.outputs.image }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set Docker image name:tag | |
id: image | |
run: | | |
export IMAGE="ghcr.io/${{ github.repository }}:$(date '+%Y-%m-%d')-$(git --no-pager log -1 --pretty=%h)" | |
echo "IMAGE=$IMAGE" >> $GITHUB_ENV | |
echo ::set-output name=image::"$IMAGE" | |
- uses: docker/setup-buildx-action@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
name: Build and push | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Dockerimage | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.IMAGE }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new | |
- run: | | |
echo "Built new image! :rocket:" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "${{ env.IMAGE }}" >> $GITHUB_STEP_SUMMARY | |
# Temp fix | |
# https://github.com/docker/build-push-action/issues/252 | |
# https://github.com/moby/buildkit/issues/1896 | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
deploy-dev: | |
runs-on: ubuntu-latest | |
needs: build | |
env: | |
IMAGE: ${{ needs.build.outputs.image }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Deploy to dev | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
CLUSTER: dev-gcp | |
VAR: ingress=https://data.intern.dev.nav.no/ | |
RESOURCE: .nais/nais.yaml | |
deploy-prod: | |
runs-on: ubuntu-latest | |
needs: [build, deploy-dev] | |
env: | |
IMAGE: ${{ needs.build.outputs.image }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Deploy to prod | |
if: github.ref == 'refs/heads/main' | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
CLUSTER: prod-gcp | |
VAR: ingress=https://data.intern.nav.no/ | |
RESOURCE: .nais/nais.yaml,.nais/alert.yaml |