added pipefail bash script #13
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: Release Node.js app | |
on: | |
push: | |
branches: | |
- main | |
# Added specifically to avoid creating other repo and running actions from this directory only for express-app | |
paths: | |
- "part3/express-app/**" | |
- ".github/workflows/part3-express-app.yml" | |
jobs: | |
publish-docker-hub: | |
name: Publish image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: part3/express-app | |
file: part3/express-app/Dockerfile | |
push: true | |
tags: mmiglioranza22/express-app:latest | |
deploy-to-render: | |
name: Deploy image to Render | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Render Deployment | |
uses: sws2apps/[email protected] | |
# condition to test it works, commit message #skip does not trigger deploy | |
if: ${{ github.event_name == 'push' && !contains(toJson(github.event.commits.*.message), '#skip')}} | |
with: | |
serviceId: ${{ secrets.RENDER_SERVICE_ID }} | |
apiKey: ${{ secrets.RENDER_API_KEY }} | |
multipleDeployment: false |