Last active
July 25, 2020 04:33
-
-
Save afifalfiano/09193eb1cc854cea337e467dc6edd584 to your computer and use it in GitHub Desktop.
Github Action Auto Deployment
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 and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- uses: actions/setup-node@v1 #this installs node and npm for us | |
with: | |
node-version: '12' | |
- uses: actions/cache@v1 # this allows for re-using node_modules caching, making builds a bit faster. | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Build | |
run: | | |
npm install | |
npm run-script deploy | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: dist/myProject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment