TECH-58: New builder, optimize github actions, rename dep scope of tr… #102
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: Main | |
on: | |
push: | |
branches: ['master', 'main', 'epic/**'] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/init | |
- name: Build | |
run: npm run build | |
- name: Deploy image | |
uses: valitydev/action-deploy-docker@v2 | |
with: | |
registry-username: ${{ github.actor }} | |
registry-access-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set config | |
run: | | |
printf "$APP_ENV_FILE" > dist/browser/assets/appConfig.json | |
printf "$AUTH_ENV_FILE" > dist/browser/assets/authConfig.json | |
echo $FAVICO | base64 -d > dist/browser/favicon.ico | |
printf "$LOGO" > dist/browser/assets/icons/logo.svg | |
env: | |
APP_ENV_FILE: ${{secrets.APP_CONFIG_CF}} | |
AUTH_ENV_FILE: ${{secrets.AUTH_CONFIG_CF}} | |
FAVICO: ${{secrets.FAVICON_BASE}} | |
LOGO: ${{secrets.LOGO_SVG}} | |
- name: Publish to CF Pages | |
uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: 'dashboard' | |
directory: 'dist/browser' | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
notify: | |
name: Notify | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: valitydev/action-mattermost-notify@v0.1.4 | |
with: | |
webhook: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | |
channel: 'frontend' | |
username: 'Frontend' |