This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
Merge pull request #426 from beabee-communityrm/fix/missing-content #90
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: Release | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
check: | |
uses: ./.github/workflows/check.yml | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup | |
- run: cp .env.example .env | |
- run: npm test | |
push: | |
runs-on: ubuntu-latest | |
needs: [check, test] | |
outputs: | |
version: ${{ steps.app_meta.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: app_meta | |
uses: docker/metadata-action@v4 | |
with: | |
flavor: | | |
latest=false | |
images: | | |
${{ secrets.DOCKER_ORGANISATION }}/beabee | |
tags: | | |
type=ref,event=tag | |
release | |
- id: router_meta | |
uses: docker/metadata-action@v4 | |
with: | |
flavor: | | |
latest=false | |
images: | | |
${{ secrets.DOCKER_ORGANISATION }}/router | |
tags: | | |
type=ref,event=tag | |
release | |
- uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: docker/build-push-action@v4 | |
with: | |
context: . | |
target: app | |
push: true | |
tags: ${{ steps.app_meta.outputs.tags }} | |
labels: ${{ steps.app_meta.outputs.labels }} | |
build-args: | | |
REVISION=${{ github.sha }} | |
- uses: docker/build-push-action@v4 | |
with: | |
context: . | |
target: router | |
push: true | |
tags: ${{ steps.router_meta.outputs.tags }} | |
labels: ${{ steps.router_meta.outputs.labels }} | |
build-args: | | |
REVISION=${{ github.sha }} | |
release: | |
runs-on: ubuntu-latest | |
needs: [push] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: beabee-communityrm/hive-deploy-stack | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- run: | | |
git config --global user.name "Deploy bot" | |
git config --global user.email "<>" | |
echo -n ${{ needs.push.outputs.version }} > API_VERSION | |
./update.sh | |
git add API_VERSION docker-compose.yml | |
if ! git diff --quiet --cached; then | |
git commit -m "Deploy API ${{ needs.push.outputs.version }}" | |
git push | |
fi |