This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
Merge pull request #136 from navikt/dependabot/npm_and_yarn/word-wrap… #226
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: Test, build and update | |
on: push | |
env: | |
CI: true | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test | |
update-dev: | |
name: Upload files to dev GCS | |
if: github.ref == 'refs/heads/dev' | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: 'write' # Used to authenticate with Google Cloud | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test | |
- name: Build application | |
run: npm run build | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
workload_identity_provider: projects/168288490841/locations/global/workloadIdentityPools/github/providers/github-action | |
service_account: pto-dev-2fbb@appspot.gserviceaccount.com | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
- name: Upload files to GCS | |
run: gsutil -m rsync -r build gs://behovsvurdering-dev | |
update-gh-pages: | |
name: Update GitHub pages | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: 'write' # Used to authenticate with Google Cloud | |
if: github.ref == 'refs/heads/dev' | |
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: Build mock application | |
run: npm run build:mock | |
- name: Update GitHub pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build | |
update-prod: | |
name: Upload files to prod GCS | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: 'write' # Used to authenticate with Google Cloud | |
contents: 'write' # Create release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test | |
- name: Build application | |
run: npm run build | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
workload_identity_provider: projects/230235624122/locations/global/workloadIdentityPools/github/providers/github-action | |
service_account: pto-prod@pto-prod-4dd0.iam.gserviceaccount.com | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
- name: Upload files to GCS | |
run: gsutil -m rsync -r build gs://behovsvurdering-prod | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Production environment updated | |
target_commitish: master | |
tag_name: release/prod@${{ github.sha }} |