Skip to content
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

Enhancement proposal: dry run / test mode #451

Open
vincerubinetti opened this issue Aug 16, 2020 · 4 comments
Open

Enhancement proposal: dry run / test mode #451

vincerubinetti opened this issue Aug 16, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request proposal

Comments

@vincerubinetti
Copy link

vincerubinetti commented Aug 16, 2020

npm-publish has a nice feature called --dry-run that lets you test what the command is going to do without actually doing it. It might be nice to have something like that in actions-gh-pages.

It could look like this:

name: ci
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code # blah blah blah
      - name: Set up Node # blah blah blah
      - name: Install packages # blah blah blah
      - name: Build app # blah blah blah
      - name: Test deploy
        uses: peaceiris/actions-gh-pages@v3
        if: github.event_name == 'pull_request' # on pull request
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          dry_run: true
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        if: github.event_name == 'push' # on push to master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

That way, on each pull request, I can see if this actions-gh-pages step in the CI workflow throws any errors, and I can get a list of what would've been published to the gh-pages branch (and any other helpful info). This would give me confidence that it will work fine when pushing/merging into master.

@peaceiris
Copy link
Owner

Thank you for the suggestion. Good idea.

I'm assuming usage like the following.

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./public
    dry_run: ${{ github.event_name == 'pull_request' }}

@peaceiris peaceiris mentioned this issue Oct 11, 2020
2 tasks
@peaceiris
Copy link
Owner

peaceiris commented Oct 11, 2020

Could you test #513 as follows?

- name: Deploy
  uses: peaceiris/actions-gh-pages@41f7401 #513
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    dry_run: ${{ github.event_name == 'pull_request' }}

@vincerubinetti
Copy link
Author

Sorry for the delay. It seems like it worked:

https://github.com/vincerubinetti/word4word/runs/1295010202?check_suite_focus=true

@peaceiris peaceiris added the enhancement New feature or request label Aug 10, 2021
@danielhaap83
Copy link

Hi @peaceiris,

what is the status of this Issue? I can see a PR already. Is it working? Why is it not yet merged? If there are still some TODO's for the PR I might be able to support (if OK of course).

This feature would be very nice to have.

BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request proposal
Projects
None yet
Development

No branches or pull requests

3 participants