|
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - develop |
| 8 | +env: |
| 9 | + IMAGE_NAME: ghcr.io/lemoncode/code-paster:dev-${{github.sha}}-${{github.run_attempt}} |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: 'read' |
| 13 | + packages: 'write' |
8 | 14 |
|
9 | 15 | jobs: |
10 | | - dev-cd: |
11 | | - uses: lemoncode/actions/.github/workflows/aws-ebs.yml@main |
12 | | - with: |
13 | | - files-to-zip: "back/** back/.babelrc front/** front/.babelrc Dockerfile .dockerignore" |
14 | | - dockerArgs: "BASE_API_URL=https://dev.codepaster.net \ |
15 | | - BASE_SOCKET_URL=https://dev.codepaster.net" |
16 | | - secrets: |
17 | | - AWS_EB_APP_NAME: ${{secrets.DEV_AWS_EB_APP_NAME}} |
18 | | - AWS_EB_ENV_NAME: ${{secrets.DEV_AWS_EB_ENV_NAME}} |
19 | | - AWS_DEPLOY_ACCESS_KEY_ID: ${{secrets.DEV_AWS_DEPLOY_ACCESS_KEY_ID}} |
20 | | - AWS_DEPLOY_SECRET_ACCESS_KEY: ${{secrets.DEV_AWS_DEPLOY_SECRET_ACCESS_KEY}} |
21 | | - AWS_REGION: ${{secrets.DEV_AWS_REGION}} |
22 | | - AWS_DEPLOY_S3_BUCKET: ${{secrets.DEV_AWS_DEPLOY_S3_BUCKET}} |
| 16 | + deploy: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + environment: |
| 19 | + name: 'Development' |
| 20 | + url: https://dev-codepaster.azurewebsites.net |
| 21 | + steps: |
| 22 | + - name: Checkout repository |
| 23 | + uses: actions/checkout@v3 |
| 24 | + |
| 25 | + - name: Log in to GitHub container registry |
| 26 | + uses: docker/login-action@v2 |
| 27 | + with: |
| 28 | + registry: ghcr.io |
| 29 | + username: ${{ github.actor }} |
| 30 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + |
| 32 | + - name: Build and push docker image |
| 33 | + run: | |
| 34 | + docker build \ |
| 35 | + --build-arg BASE_API_URL=https://dev-codepaster.azurewebsites.net \ |
| 36 | + --build-arg BASE_SOCKET_URL=https://dev-codepaster.azurewebsites.net \ |
| 37 | + -t ${{env.IMAGE_NAME}} -f azure.Dockerfile . |
| 38 | + docker push ${{env.IMAGE_NAME}} |
| 39 | +
|
| 40 | + - name: Deploy to Azure |
| 41 | + uses: azure/webapps-deploy@v2 |
| 42 | + with: |
| 43 | + app-name: ${{ secrets.DEV_AZURE_APP_NAME }} |
| 44 | + publish-profile: ${{ secrets.DEV_AZURE_PUBLISH_PROFILE }} |
| 45 | + images: ${{env.IMAGE_NAME}} |
0 commit comments