Skip to content

update "new" threshhold to 7 days #238

update "new" threshhold to 7 days

update "new" threshhold to 7 days #238

name: Build and Deploy
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install htmlc globally
run: npm install -g @sojs_coder/[email protected]
# - name: Build Sitemap
# run: node generate_sitemap.js
- name: Build roms.json
env:
ROMS_AWS_ACCESS_KEY: ${{ secrets.ROMS_AWS_ACCESS_KEY }}
ROMS_AWS_SECRET_ACCESS_KEY: ${{ secrets.ROMS_AWS_SECRET_ACCESS_KEY }}
run: |
cd static/roms
npm install
node build.js
- name: Build static site
run: htmlc static --out=build
- name: Copy and Modify .gitattributes
run: |
node modify_gitattr.js
cp .gitattributes build/.gitattributes
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_branch: gh-pages
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy: ${{ github.event.head_commit.message }}'
enable_jekyll: false
deploy-to-surge:
needs: build-and-deploy-gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install -g surge
- run: surge --project ./ --domain ${{ secrets.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}
deploy-to-s3:
needs: build-and-deploy-gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.S3_UPLOAD_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.S3_UPLOAD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Deploy to S3
run: |
aws s3 sync . s3://ccported --delete
sync-biggamescript:
needs: build-and-deploy-gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.S3_UPLOAD_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.S3_UPLOAD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Deploy to S3
run: |
aws s3 cp big_game_script.js s3://ccportedgames/big_game_script.js
deploy-to-firebase:
needs: build-and-deploy-gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CCPORTED }}
channelId: live
projectId: ccported
deploy-to-github-pages:
needs: build-and-deploy-gh-pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
lfs: true
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4