1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 17:05:32 -04:00

safer paths for action temp files & swap access tokens

This commit is contained in:
2019-10-22 14:52:12 -04:00
parent cc9e2b4f23
commit f3a3dc1646

View File

@@ -20,7 +20,7 @@ jobs:
# Can't use native `uses: docker://` syntax for GitHub Package Registry...
- name: Build Hugo
run: |
echo ${{ secrets.GITHUB_REGISTRY_TOKEN }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
echo ${{ secrets.GITHUB_ACCESS_TOKEN }} | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
docker run -v $GITHUB_WORKSPACE:/src docker.pkg.github.com/jakejarvis/hugo-custom/hugo-custom:latest --gc --cleanDestinationDir
docker logout docker.pkg.github.com
@@ -28,9 +28,8 @@ jobs:
# add a CNAME file for a custom domain (jarv.is).
- name: Prepare for GitHub Pages
run: |
mkdir gh-pages
cp -r public/* gh-pages
echo "jarv.is" > gh-pages/CNAME
cp -r $GITHUB_WORKSPACE/public $HOME/gh-pages
echo "jarv.is" > $HOME/gh-pages/CNAME
# Initialize a sub-repository in the new gh-pages directory and
# add jakejarvis/jakejarvis.github.io as a remote.
@@ -38,11 +37,11 @@ jobs:
# this setup is a weird edge case not worth making an action for.
- name: Deploy to jakejarvis.github.io
run: |
cd gh-pages
cd $HOME/gh-pages
git init
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git remote add target https://${{ secrets.GITHUB_ACCESS_TOKEN }}@github.com/jakejarvis/jakejarvis.github.io.git
git remote add origin https://${{ secrets.GITHUB_ACCESS_TOKEN }}@github.com/jakejarvis/jakejarvis.github.io.git
git add -A
git commit -m "GitHub Pages deploy from $GITHUB_REPOSITORY@$GITHUB_SHA"
git push --force target master
git push --force origin master