Legg til workflow permissions #2
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: 'deploy: Ingress-redirect' | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- '.github/workflows/deploy-ingress-redirect.yaml' | |
- 'apps/ingress-redirect/**' | |
env: | |
IMAGE: docker.pkg.github.com/${{ github.repository }}/teamfront${{ github.ref == 'refs/heads/main' }}:${{ github.sha }} | |
defaults: | |
run: | |
working-directory: apps/ingress-redirect | |
jobs: | |
build: | |
name: Ingress-redirect - build and push docker | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Docker | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
docker build --tag ${IMAGE} . | |
docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY} -p ${GITHUB_TOKEN} | |
docker push ${IMAGE} | |
deploy-preprod: | |
name: Ingress-redirect - deploy Dev FSS | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-fss | |
RESOURCE: apps/ingress-redirect/nais/frontend-fss.yaml | |
VARS: apps/ingress-redirect/nais/frontend-dev-fss-vars.yaml | |
ENVIRONMENT: dev-fss:teamdatajegerne:team-catalog-frontend | |
deploy-prod: | |
name: Ingress-redirect - deploy Prod FSS | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-fss | |
RESOURCE: apps/ingress-redirect/nais/frontend-fss.yaml | |
VARS: apps/ingress-redirect/nais/frontend-prod-fss-vars.yaml | |
ENVIRONMENT: prod-fss:teamdatajegerne:team-catalog-frontend | |
deploy-prod-sandbox: | |
name: ingress-redirect - deploy Sandbox Prod FSS | |
needs: build | |
if: github.ref == 'refs/heads/sandbox' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-fss | |
RESOURCE: apps/ingress-redirect/nais/frontend-fss.yaml | |
VARS: apps/ingress-redirect/nais/frontend-prod-fss-sandbox-vars.yaml | |
ENVIRONMENT: prod-fss:teamdatajegerne:team-catalog-sandbox-frontend |