Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: updated actions to common workflow #219

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 7 additions & 23 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,10 @@ name: Deploy to Firebase Hosting on merge
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm install
- name: Generate .env file
run: cp .env.example .env
- name: Build
run: npm run build
- name: Install Firebase
run: npm install -g firebase-tools
- name: Set Firebase project
run: firebase use default --token "$HOTWAX_PUBLIC_SECRET"
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
- name: Deploy
run: firebase deploy --token "$HOTWAX_PUBLIC_SECRET" -m "Deploying via GitHub actions" --only hosting:dev
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
call-workflow-in-another-repo:
uses: hotwax/dxp-components/.github/workflows/common-firebase-hosting-merge.yml@main
with:
config-path: .github/labeler.yml
secrets:
envPAT: ${{ secrets.envPAT }}
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
36 changes: 10 additions & 26 deletions .github/workflows/firebase-hosting-release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on release
'on':
push:
tags:
- '*' # Push events to every tag not containing / Refer https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#patterns-to-match-branches-and-tags
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Checkout to latest release tag
run: |
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
- name: Install Dependencies
run: npm install
- name: Generate .env file
run: cp .env.example .env
- name: Build
run: npm run build
- name: Install Firebase
run: npm install -g firebase-tools
- name: Set Firebase project
run: firebase use default --token "$HOTWAX_PUBLIC_SECRET"
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
- name: Deploy
run: firebase deploy --token "$HOTWAX_PUBLIC_SECRET" -m "Deploying via GitHub actions" --only hosting:uat
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
call-workflow-in-another-repo:
uses: hotwax/dxp-components/.github/workflows/common-firebase-hosting-release.yml@main
with:
config-path: .github/labeler.yml
secrets:
envPAT: ${{ secrets.envPAT }}
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
35 changes: 9 additions & 26 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@ name: Verify build

on:
push:
branches: [ main ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]

branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}


- name: Install Dependencies
run: npm install
- name: Generate .env file
run: cp .env.example .env
- name: Build
run: npm run build
jobs:
call-workflow-in-another-repo:
uses: hotwax/dxp-components/.github/workflows/common-pull-request.yml@main
with:
config-path: .github/labeler.yml
secrets:
envPAT: ${{ secrets.envPAT }}