name: Deploy app on: push: branches: - master jobs: api-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 api-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - 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: 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