tracker-api-go/.github/workflows/master.yml

53 lines
1.7 KiB
YAML
Raw Normal View History

2022-12-05 20:39:09 +01:00
name: Deploy app
on:
push:
branches:
2022-12-05 20:39:53 +01:00
- main
2022-12-05 20:39:09 +01:00
jobs:
api-deploy:
runs-on: ubuntu-latest
steps:
2022-12-05 20:46:07 +01:00
- uses: actions/checkout@v3
2022-12-05 20:42:14 +01:00
with:
submodules: "true"
2022-12-05 20:39:09 +01:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: container-registry.nocodelytics.com
username: nocodelytics
password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
2022-12-05 20:48:09 +01:00
context: .
2022-12-05 20:39:09 +01:00
platforms: linux/amd64,linux/arm64
push: true
tags: |
nocodelytics/tracker-api:latest
nocodelytics/tracker-api:${{ github.sha }}
# # Migrate database
# - name: migrate db
# run: docker run -v $(pwd)/api/migrations:/migrations --network host migrate/migrate -source file://migrations -database "${{ secrets.DATABASE_URL }}" up
# # deploy
# - name: Restore infra cache
# uses: actions/cache@v2
# with:
# path: infra/node_modules
# key: ${{ runner.OS }}-npm-cache-${{ hashFiles('infra/package-lock.json') }}
# - uses: actions/setup-node@v2
# with:
# node-version: "16.0"
# - name: npm install
# run: npm --prefix=infra install
# # - name: Setup upterm session
# # uses: lhotari/action-upterm@v1
# # Deploy on Kubernetes
# - name: Deploy
# run: npm --prefix=infra run updateVersion -- --namespace=stage --tag=$DOCKER_TAG