Update issue templates #58
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upgrade Version and Deploy | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- 'main' | ||
jobs: | ||
upgrade-version: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.pull_request.merged == true }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- name: Check out the repo and login with bot account | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup Java 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'oracle' | ||
java-version: '21.0.3' | ||
cache: 'maven' | ||
cache-dependency-path: 'server/pom.xml' | ||
- name: Setup Git | ||
env: | ||
GIT_AUTHOR_NAME: GitHub Actions | ||
GIT_AUTHOR_EMAIL: "[email protected]" | ||
run: | | ||
git config --global user.name "${{env.GIT_AUTHOR_NAME}}" | ||
git config --global user.email "${{env.GIT_AUTHOR_EMAIL}}" | ||
- name: Retrieve versions | ||
id: versions | ||
shell: bash | ||
run: | | ||
VERSIONS=$(scripts/retrieve-versions.sh server/pom.xml) | ||
NEXT_VERSION=$(echo $VERSIONS | cut -d ':' -f 1) | ||
NEW_SNAPSHOT=$(echo $VERSIONS | cut -d ':' -f 2) | ||
echo "next_version=$(echo $VERSIONS | cut -d ':' -f 1)" >> $GITHUB_OUTPUT | ||
echo "new_snapshot=$(echo $VERSIONS | cut -d ':' -f 2)" >> $GITHUB_OUTPUT | ||
- name: Upgrade server pom version to ${{ steps.versions.outputs.next_version }} | ||
shell: bash | ||
run: | | ||
mvn versions:set -DnewVersion=${{ steps.versions.outputs.next_version }} --file server/pom.xml | ||
- name: Upgrade version in README.md | ||
shell: bash | ||
run: | | ||
sed -i 's/https:\/\/img.shields.io\/badge\/Version-[0-9]\+\.[0-9]\+\.[0-9]-blue/https:\/\/img.shields.io\/badge\/Version-${{ steps.versions.outputs.next_version }}-blue/g' README.md | ||
sed -i 's/image: heavynimbus\/heavy-mock-http-server:[0-9]\+\.[0-9]\+\.[0-9]/image: heavynimbus\/heavy-mock-http-server:${{ steps.versions.outputs.next_version }}/g' README.md | ||
- name: Git Add changes | ||
run: git add server/pom.xml README.md | ||
- name: Git Commit changes | ||
run: git commit -m "🚀⬆️ Upgrade version to ${{ steps.versions.outputs.next_version }}" | ||
- name: Git Tag ${{ steps.versions.outputs.next_version }} | ||
run: git tag ${{ steps.versions.outputs.next_version }} HEAD | ||
- name: Git Push changes and tags | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
run: git push --force origin HEAD:${{ github.ref_name }} --tags | ||
Check failure on line 81 in .github/workflows/upgrade-version.yml GitHub Actions / Upgrade Version and DeployInvalid workflow file
|
||
- name: Build Docker image ${{ steps.versions.outputs.next_version }} | ||
env: | ||
NEXT_VERSION: ${{ steps.versions.outputs.next_version }} | ||
run: | | ||
docker build -t heavy-mock-http-server:$NEXT_VERSION server | ||
- name: Push Docker image ${{ steps.versions.outputs.next_version }} | ||
env: | ||
NEXT_VERSION: ${{ steps.versions.outputs.next_version }} | ||
run: | | ||
docker tag "heavy-mock-http-server:$NEXT_VERSION" "heavynimbus/heavy-mock-http-server:$NEXT_VERSION" | ||
docker push "heavynimbus/heavy-mock-http-server:$NEXT_VERSION" | ||
- name: Set snapshot version | ||
run: | | ||
mvn versions:set -DnewVersion=${{ steps.versions.outputs.new_snapshot }} --file server/pom.xml | ||
- name: Git Add changes | ||
run: git add server/pom.xml | ||
- name: Git Commit changes | ||
run: git commit -m "⬆️ Upgrade version to ${{ steps.versions.outputs.new_snapshot }}" | ||
- name: Git Push changes | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
run: git push --force origin HEAD:${{ github.ref_name }} |