-
Notifications
You must be signed in to change notification settings - Fork 8.1k
refactor and mutualize netlify and aws clients for deployment #14803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,27 @@ | ||
| name: remove published site from netlify | ||
| name: clean-pr | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - closed | ||
|
|
||
| jobs: | ||
| remove-site-from-netlify: | ||
| name: build | ||
| runs-on: ubuntu-18.04 | ||
| netlify-remove: | ||
| runs-on: ubuntu-20.04 | ||
| if: github.event.pull_request.head.repo.fork == false | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - | ||
| name: Checkout | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| - name: delete from netlify | ||
| uses: ./.github/actions/netlify-clean | ||
| - | ||
| name: Remove site from Netlify | ||
| uses: docker/bake-action@v2 | ||
| with: | ||
| netlify_token: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
| site_name: "${{ github.repository }}/${{ github.head_ref }}" | ||
| targets: netlify-remove | ||
| set: | | ||
| *.cache-from=type=gha,scope=releaser | ||
| env: | ||
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
| NETLIFY_SITE_NAME: ${{ github.repository }}/${{ github.head_ref }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this refactoring we might enable this workflow and see if it works fine now but don't think it's necessary to have it anymore if we want to only accept pull requests from forks and disable auto publish. Step would look like this:
- name: Netlify deploy if: github.event.pull_request.head.repo.fork == false uses: docker/bake-action@v2 with: targets: netlify-deploy env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_ACCOUNT_SLUG: ${{ secrets.NETLIFY_ACCOUNT_SLUG }} NETLIFY_SITE_NAME: ${{ github.repository }}/${{ github.head_ref }} NETLIFY_PUBLISH_DIR: "_site"