Skip to content

Instantly share code, notes, and snippets.

@cjfswd
Created May 31, 2022 17:36
Show Gist options
  • Save cjfswd/0dbf9e82713cf4ca779aaebd04f30f60 to your computer and use it in GitHub Desktop.
Save cjfswd/0dbf9e82713cf4ca779aaebd04f30f60 to your computer and use it in GitHub Desktop.
github action to generate schedule cache files
name: Generate cache file
on:
# Triggers the workflow everyday
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
environment: app
name: build and push
steps:
- name: git-checkout
uses: actions/checkout@v2
with: { ref: development }
- name: 'Create env file'
run: |
touch .env
echo TOKEN=${{ secrets.TOKEN }} >> .env
echo GUILD_URL=${{ secrets.GUILD_URL }} >> .env
cat .env
- name: install dependencies
run: npm install
- name: build
run: npm run build # The build command of your project
- name: start
run: npm run start # The build command of your project
- name: push
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: deploy # The branch name where you want to push the assets
SQUASH_HISTORY: true # true = reset history, false = mantain history
FOLDER: public # The directory where your assets are generated
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub will automatically add this - you don't need to bother getting a token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment