Skip to content

Instantly share code, notes, and snippets.

@ozkary
Last active March 22, 2022 14:45
Show Gist options
  • Save ozkary/41d0934b04ccf7e39892b3e6c8b316b3 to your computer and use it in GitHub Desktop.
Save ozkary/41d0934b04ccf7e39892b3e6c8b316b3 to your computer and use it in GitHub Desktop.
Branding Apps with GitHub Actions
name: Ozkary Brand A CI/CD
on:
push:
branches:
- brand-a
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- brand-a
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: copy branded content files
id: contentfiles
run : cp ./.brands/.brand-a/content/*.json ./src/content/content
- name: delete target fonts files and copy branded files
id: fontfiles
run : |
find ./src/content/fonts/* -delete
cp ./.brands/fonts* ./src/content/fonts
- name: copy styles variables
id: stylefiles
run : cp ./.brand/.brand-a/styles/* ./src/content/styles
- name: copy branded images to the public image folder
id: imagefiles
run : cp -r ./.brands/brand-a/images/* ./public/images
- name: Build And Deploy
id: builddeploy
uses: Azure/[email protected]
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_OZKARY_COM_9847CB734 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
app_location: "/" # App source code path
api_location: "/api" # Api source code path - optional
app_artifact_location: "build" # build location
# output_location: ".github/workflows" # Built app content directory - optional
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/[email protected]
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_OZKARY_COM_9847CB734 }}
action: "close"
name: Ozkary Brand A CI/CD
on:
push:
branches:
- brand-a
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- brand-a
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/[email protected]
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_OZKARY_COM_9847CB734 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
app_location: "/" # App source code path
api_location: "/api" # Api source code path - optional
app_artifact_location: "build" # build location
# output_location: ".github/workflows" # Built app content directory - optional
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/[email protected]
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_OZKARY_COM_9847CB734 }}
action: "close"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment