Skip to content

Update scripts.ejs

Update scripts.ejs #69

Workflow file for this run

name: Generate Site
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'site/**'
permissions: write-all
env:
GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ env.GITHUB_TOKEN }}
submodules: 'recursive'
- uses: actions/setup-node@v3
with:
node-version: 'latest'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build site
env:
NODE_OPTIONS: --max-old-space-size=5168
run: |
git config --global user.email "me@anthonyrussano.com"
git config --global user.name "Anthony Russano"
git submodule init
git submodule update
git pull
cd public
git switch main
git pull
rm -rf *
cd ..
cd site
npm install
node_modules/hexo/bin/hexo gen -c 1
cd ..
cd public
git add .
git commit -m "workflow publish"
git push
cd ..
git add .
git commit -m "workflow deploy"
git push
- name: Prepare Docker Image
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
echo ::set-output name=tags::${TAGS}
echo ::set-output name=docker_image::${DOCKER_IMAGE}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker Image
id: docker-build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.prep.outputs.tags }}