Skip to content

Commit

Permalink
Fix: deployment fail (#191)
Browse files Browse the repository at this point in the history
* Fix: override `WORKDIR` command

* Patch: disabled if condition for testing

* Patch: disable preceding workflow

* Patch: add verbose option to check path

* Patch: use `root` user according to actions/checkout#1014

* Patch: add a `chown` step to take ownership

According to actions/checkout#211

* Patch: removed `sudo` as it's not found

* Patch: add a `path` parameter?

* Patch: try changing pwd

* Patch: add `ls` to check what's happening

* Patch: replace `--local` using `--global`

* Patch: fix dubious ownership

* Patch: trying to fix detached HEAD

* Revert "Patch: disable preceding workflow"

This reverts commit 2d1c778.

* Revert "Patch: add verbose option to check path"

This reverts commit 86d5211.

* Revert "Patch: disabled if condition for testing"

This reverts commit 83d4c4a.

* Patch: remove `--dry-run` in deploy step

* Patch: trying to remove `chown` step
  • Loading branch information
HuangFuSL authored Aug 17, 2023
1 parent 144a382 commit bf3072d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ jobs:
build:
name: Build documentation
runs-on: ubuntu-latest
container: ghcr.io/huangfusl/blog-env:${{ inputs.build-type }}
container:
image: ghcr.io/huangfusl/blog-env:${{ inputs.build-type }}
options: --user root
steps:

- name: Checkout Main
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
path: '.'
ref: 'main'

- name: Test
if: inputs.deploy == false
Expand All @@ -44,8 +48,10 @@ jobs:
- name: Set up Deploy Environment
if: inputs.deploy
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
cd $GITHUB_WORKSPACE
ls -al
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Deploy
if: inputs.deploy
Expand All @@ -54,5 +60,5 @@ jobs:
run: |
chown -R root:root $PWD
. /root/venv/bin/activate
git pull
git checkout main && git pull
python3 ./ci/deploy.py
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ COPY ./requirements.txt /tmp/requirements.txt
RUN python3 -m venv /root/venv \
&& . /root/venv/bin/activate \
&& pip3 install -r /tmp/requirements.txt --no-cache-dir

# Override the entrypoint defined in the base image
WORKDIR /

0 comments on commit bf3072d

Please sign in to comment.