Created
January 3, 2022 19:01
-
-
Save ArveSystad/b7db8a79ee20341b97de28285d9f4cd7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: '16.x' | |
- name: Install yarn | |
run: yarn install -g | |
- name: yarn build+install | |
run: | | |
yarn install --frozen-lockfile | |
yarn tsc | |
yarn build | |
- 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 }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment