This repository has been archived by the owner on May 15, 2024. It is now read-only.
Fjerner veilarbmaofs i dev (#351) #14
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 to prod | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
env: | |
CI: true | |
TZ: Europe/Amsterdam | |
jobs: | |
deploy-prod: | |
name: Deploy application to prod | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test | |
- name: Build application | |
run: npm run build | |
env: | |
PUBLIC_URL: https://veilarbmaofs.intern.nav.no | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v0 | |
with: | |
credentials_json: ${{ secrets.GCS_SA_KEY_PROD }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
- name: Upload files to GCS | |
run: gsutil -m rsync -r build gs://veilarbmaofs-prod | |
- name: Create release tag | |
run: echo "RELEASE_TAG=$(TZ=\"Europe/Oslo\" date +%Y.%m.%d_%H.%M)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release to prod | |
target_commitish: master | |
tag_name: release/prod@${RELEASE_TAG} |