If it builds, it pushes to main branch and deploys to production #8
This file contains 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: autodeploy | |
run-name: If it builds, it pushes to main branch and deploys to production | |
on: | |
push: | |
branches-ignore: | |
- main | |
jobs: | |
check-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.11' | |
- run: npm install | |
- run: git config --global user.email "${{ secrets.PUBLISHER_EMAIL }}" | |
- run: git config --global user.name "${{ secrets.PUBLISHER_NAME }}" | |
- run: npm run deploy | |
env: | |
GIT_USER: ${{ secrets.PUBLISHER_NAME }} | |
GIT_PASS: ${{ secrets.PUBLISHER_TOKEN }} | |
GIT_USER_EMAIL: ${{ secrets.PUBLISHER_EMAIL }} | |
- uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
force: true |