Skip to content

Commit

Permalink
only run some build steps if the GH_API_TOKEN secret is set
Browse files Browse the repository at this point in the history
  • Loading branch information
slr71 committed Feb 19, 2024
1 parent 4ea0a1b commit ac4b9b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
pipeline:
name: Skaffold Docker build
runs-on: ubuntu-20.04
env:
GH_API_TOKEN: ${{secrets.GH_API_TOKEN}}
steps:
- name: Set Environment
run: |
Expand All @@ -32,23 +34,28 @@ jobs:
cd "${REPO_NAME}"
go build .
- uses: ncipollo/release-action@v1
- name: Create Release
uses: ncipollo/release-action@v1
if: ${{ env.GH_API_TOKEN != '' }}
with:
artifacts: "${REPO_NAME}/${EXECUTABLE_NAME}"
prerelease: true

- name: Pull de-releases
if: ${{ env.GH_API_TOKEN != '' }}
uses: actions/checkout@v4
with:
repository: cyverse-de/de-releases
path: de-releases

- name: Install jq
if: ${{ env.GH_API_TOKEN != '' }}
run: |
apt-get update
apt-get install -y jq
- name: Update Release Record
if: ${{ env.GH_API_TOKEN != '' }}
run: |
cd de-releases
git config user.name "GitHub Actions Bot"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
pipeline:
name: Skaffold Docker build
runs-on: ubuntu-20.04
env:
GH_API_TOKEN: ${{secrets.GH_API_TOKEN}}
steps:

- name: Set Environment
Expand Down Expand Up @@ -35,21 +37,25 @@ jobs:
- name: Create Release
uses: ncipollo/release-action@v1
if: ${{ env.GH_API_TOKEN != '' }}
with:
artifacts: "${REPO_NAME}/${EXECUTABLE_NAME}"

- name: Pull de-releases
uses: actions/checkout@v4
if: ${{ env.GH_API_TOKEN != '' }}
with:
repository: cyverse-de/de-releases
path: de-releases

- name: Install jq
if: ${{ env.GH_API_TOKEN != '' }}
run: |
apt-get update
apt-get install -y jq
- name: Update Release Record
if: ${{ env.GH_API_TOKEN != '' }}
run: |
cd de-releases
git config user.name "GitHub Actions Bot"
Expand Down

0 comments on commit ac4b9b0

Please sign in to comment.