diff --git a/.github/workflows/dev-manual.yml b/.github/workflows/dev-manual.yml index 428512f..762d063 100644 --- a/.github/workflows/dev-manual.yml +++ b/.github/workflows/dev-manual.yml @@ -7,7 +7,15 @@ jobs: name: deploy-theme runs-on: [self-hosted, linux, stage] steps: - - uses: actions/checkout@v3 + - name: setup-git + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + - name: clone-repo + run: | + git clone https://github.com/${{ github.repository }} repo + cd repo + git checkout ${{ github.sha }} - name: deploy-theme run: | chown -R :client . diff --git a/.github/workflows/prod-deploy.yml b/.github/workflows/prod-deploy.yml index 25c7835..7efec8f 100644 --- a/.github/workflows/prod-deploy.yml +++ b/.github/workflows/prod-deploy.yml @@ -5,14 +5,21 @@ on: jobs: deploy-theme: + if: github.ref == 'refs/heads/main' name: deploy-theme runs-on: [self-hosted, linux, prod] steps: - - name: checkout code - uses: actions/checkout@v3 - + - name: setup-git + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + - name: clone-repo + run: | + git clone https://github.com/${{ github.repository }} repo + cd repo + git fetch --tags + git checkout tags/${{ github.event.release.tag_name }} - name: deploy-theme - if: github.ref == 'refs/heads/main' run: | chown -R :client . chmod -R g+w . diff --git a/.github/workflows/stage-deploy.yml b/.github/workflows/stage-deploy.yml index 5df3932..694c09d 100644 --- a/.github/workflows/stage-deploy.yml +++ b/.github/workflows/stage-deploy.yml @@ -15,7 +15,15 @@ jobs: name: deploy-theme runs-on: [self-hosted, linux, stage] steps: - - uses: actions/checkout@v3 + - name: setup-git + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + - name: clone-repo + run: | + git clone https://github.com/${{ github.repository }} repo + cd repo + git checkout ${{ github.ref_name }} - name: deploy-theme run: | chown -R :client .