Skip to content

Commit

Permalink
ci: add different checkouts for each release
Browse files Browse the repository at this point in the history
  • Loading branch information
Educc28 committed Aug 9, 2023
1 parent 3b65ec4 commit 4430948
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/develop.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
release:
types:
- created
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/release.yaml
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 }}

0 comments on commit 4430948

Please sign in to comment.