Skip to content

test workflow

test workflow #38

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Deploy Stack
on:
push:
branches:
- "flyio"
workflow_dispatch:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
test-api:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Test api
working-directory: ./catchemall/web-api
run: ./test.sh
build-push-api:
needs: test-api
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Log in to registry
uses: docker/login-action@v2
with:
username: ${{ secrets.CONTAINER_USERNAME }}
password: ${{ secrets.CONTAINER_PASSWORD }}
- name: Web Api - Build and Push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ secrets.REPOSITORY_NAME }}/catchemall-api:${{ github.sha }}, ${{ secrets.REPOSITORY_NAME }}/catchemall-api
context: ./catchemall/web-api
file: ./catchemall/web-api/Dockerfile
build-push-ui:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Log in to registry
uses: docker/login-action@v2
with:
username: ${{ secrets.CONTAINER_USERNAME }}
password: ${{ secrets.CONTAINER_PASSWORD }}
- name: UI - Build and Push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ secrets.REPOSITORY_NAME }}/catchemall-ui:${{ github.sha }}, ${{ secrets.REPOSITORY_NAME }}/catchemall-ui
context: ./catchemall/ui
file: ./catchemall/ui/Dockerfile
deploy:
needs: [build-push-api, build-push-ui]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: deploy ui
run: flyctl deploy --image ${{ secrets.REPOSITORY_NAME }}/catchemall-ui:${{ github.sha }} --remote-only catchemall/ui
- name: deploy webapi
run: flyctl deploy --image ${{ secrets.REPOSITORY_NAME }}/catchemall-api:${{ github.sha }} --remote-only catchemall/web-api