deploy #1
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: Build docker image | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '20.x' | |
- name: Install yarn | |
run: yarn install -g | |
- name: yarn build+install | |
run: | | |
yarn install --frozen-lockfile | |
yarn tsc | |
yarn build:all | |
- name: 'Build and push image' | |
uses: azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- run: | | |
docker image build . --file packages/backend/Dockerfile --tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/backstage:${{ github.sha }} | |
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/backstage:${{ github.sha }} | |
- name: 'Az CLI login' | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
allow-no-subscriptions: true | |
- uses: azure/webapps-deploy@v2 | |
with: | |
app-name: ${{ secrets.APP_NAME }} | |
images: ${{ secrets.REGISTRY_LOGIN_SERVER }}/backstage:${{ github.sha }} |