Skip to content

Commit

Permalink
Merge pull request #9 from energywebfoundation/develop
Browse files Browse the repository at this point in the history
beta release
  • Loading branch information
michalziobro authored Jan 19, 2023
2 parents c5d79eb + 98bcb2b commit 861e0fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ name: Pull Request Validation

on:
pull_request:
types: [opened, synchronize]
types: [opened, synchronize, reopened, edited]
branches:
- develop
- master
- release

Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
echo "IMAGE_TAG=$(uuidgen)" >> $GITHUB_OUTPUT
echo "TAG_DRY_RUN=true" >> $GITHUB_OUTPUT
echo "PUSH_DOCKER=true" >> $GITHUB_OUTPUT
echo "PUSH_DOCKER=false" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/master" ]; then
echo "ENVIRONMENT=staging" >> $GITHUB_OUTPUT
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
Expand All @@ -72,15 +72,16 @@ jobs:
outputs:
tag: ${{ steps.tag_version.outputs.new_tag }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: release
pre_release_branches: master,develop # these branches will produce pre-release tag (eg. v0.1.2-develop.0)
pre_release_branches: master # these branches will produce pre-release tag (eg. v0.1.2-beta.0)
append_to_pre_release_tag: beta
custom_release_rules: major:major:Major Changes,minor:minor:Minor Changes,chore:patch:Chores
dry_run: ${{ needs.configure.outputs.TAG_DRY_RUN }} # pushes to develop won't trigger tagging

Expand Down Expand Up @@ -132,12 +133,23 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# When running on develop branch we want to tag Docker images with unique id and branch name only.
# When running on master and release we're adding sem ver and latest (for release) tags too.
- name: Setup Docker tags
id: tags
run: |
if [ "${{ github.ref }}" = "refs/heads/develop" ]; then
echo "TAGS=${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.configure.outputs.IMAGE_TAG }}" >> $GITHUB_OUTPUT
else
echo "TAGS=${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.configure.outputs.IMAGE_TAG }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.tag-release.outputs.tag }}" >> $GITHUB_OUTPUT
fi
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ needs.configure.outputs.PUSH_DOCKER }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.configure.outputs.IMAGE_TAG }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.tag-release.outputs.tag }}
tags: ${{ steps.tags.outputs.TAGS }}
labels: ${{ steps.meta.outputs.labels }}
file: ./docker/Dockerfile

0 comments on commit 861e0fe

Please sign in to comment.