Skip to content

Commit

Permalink
Simplified checkout process
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydrogers committed Nov 29, 2023
1 parent 10aa044 commit 3922740
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
1 change: 0 additions & 1 deletion .github/workflows/action_publish-beta-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ jobs:
uses: ./.github/workflows/service_docker-build-and-publish.yml
with:
tag-prefix: "beta-"
checkout-type: branch
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/action_publish-production-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ jobs:
uses: ./.github/workflows/service_docker-build-and-publish.yml
with:
tag-prefix: ''
checkout-type: latest-stable
secrets: inherit
39 changes: 2 additions & 37 deletions .github/workflows/service_docker-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
required: true
type: string
default: 'edge-'
checkout-type:
required: true
type: string
php-versions-file:
type: string
default: 'scripts/conf/php-versions.yml'
Expand Down Expand Up @@ -61,41 +58,9 @@ jobs:
matrix: ${{fromJson(needs.setup-matrix.outputs.php-version-map-json)}}

steps:
##
# Checkout branch (for push deployments)
##
- name: Get branch name
if: inputs.checkout-type == 'branch'
id: branch-name
uses: tj-actions/branch-names@v6

- uses: actions/checkout@v3
if: inputs.checkout-type == 'branch'
with:
ref: ${{ steps.branch-name.outputs.current_branch }}

##
# Checkout latest stable release (for production releases)
##
- name: Get latest stable release
if: inputs.checkout-type == 'latest-stable'
id: latest-stable-version
run: |
echo "LATEST_STABLE_VERSION=$(curl --silent --header "Accept: application/vnd.github.v3.sha" "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')" >> $GITHUB_OUTPUT
- name: Confirm release tag
if: inputs.checkout-type == 'latest-stable'
run: |
echo "Latest Stable Release Tag: ${{ steps.latest-stable-version.outputs.LATEST_STABLE_VERSION }}"
- name: Checkout latest stable tag
if: inputs.checkout-type == 'latest-stable'
- name: Check out code.
uses: actions/checkout@v3
with:
ref: ${{ steps.latest-stable-version.outputs.LATEST_STABLE_VERSION }}
##
# Download artifacts
##

- name: Download PHP Versions file
uses: actions/download-artifact@v3
with:
Expand Down

0 comments on commit 3922740

Please sign in to comment.