Created
April 18, 2020 16:12
-
-
Save itsabdessalam/dfd8d7a4b1edb549bb5314fc2427fe34 to your computer and use it in GitHub Desktop.
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: Production workflow | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v1 | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: Get current branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: curr_branch | |
- name: Install Netlify CLI | |
run: npm install netlify-cli -g | |
- name: Install dependencies | |
run: npm install | |
- name: Run lint | |
run: npm run lint | |
- name: Run build | |
run: npm run build | |
- name: Deploy to netlify | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
RUN_ID: ${{ github.run_id }} | |
CURR_BRANCH: ${{ steps.curr_branch.outputs.branch }} | |
shell: bash | |
run: netlify deploy --dir=dist --prod --auth $NETLIFY_AUTH_TOKEN --message="GitHub action deploy $RUN_ID on $CURR_BRANCH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment