-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add different checkouts for each release
- Loading branch information
Showing
2 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
- '![0-9]+.[0-9]+.[0-9]+-dev.[0-9]+' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: get latest release with tag | ||
id: latestrelease | ||
run: | | ||
echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/weide-zhou/ticket13/releases/latest | jq '.tag_name' | sed 's/\"//g')" | ||
- name: confirm release tag | ||
run: | | ||
echo ${{ steps.latestrelease.outputs.releasetag }} | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ steps.latestrelease.outputs.releasetag }} | ||
- name: Install Meteor | ||
run: | | ||
curl https://install.meteor.com/ | sh | ||
export METEOR_ALLOW_SUPERUSER=true | ||
meteor --version | ||
meteor node --version | ||
meteor npm --version | ||
- name: Build | ||
run: | | ||
meteor npm install | ||
meteor build --server-only /tmp/build | ||
- name: Copy build to GitHub | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: /tmp/build/Konecty.tar.gz | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Get the tag name | ||
run: | | ||
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME" | ||
echo "Tag name from github.ref_name: ${{ github.ref_name }}" | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: konecty/konecty:${{ github.ref_name }} | ||
build-args: | | ||
VERSION=${{ github.ref_name }} |