dcsil / dream-team

Team repository for Dream Team
https://dreamtune-cdf8a.web.app/auth/login
0 stars 1 forks source link

Add the commit SHA and message to the deploy to Firebase #146

Closed RyanMarten closed 4 years ago

RyanMarten commented 4 years ago

This way we can identify which commit it is and can identify which commit broke the website / which one we need to rollback to.

RyanMarten commented 4 years ago
- name: Install Firebase Tools
      run: npm install -g firebase-tools
      working-directory: app
    - name: Get Git Commit Message
      run: |
        echo ::set-env name=COMMIT_MSG::$(git log --format=%B -n 1 ${{ github.sha }})
    - name: Deploy to firebase
      working-directory: app
      run: firebase deploy --token $FIREBASE_TOKEN -m "${SHA::8} $COMMIT_MSG"
      env:
        FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
        SHA: ${{ github.sha }}

Using the github context variable: https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#env-context https://github.community/t5/GitHub-Actions/Accessing-commit-message-in-pull-request-event/td-p/40856

RyanMarten commented 4 years ago
Screen Shot 2020-03-14 at 9 01 18 AM
RyanMarten commented 4 years ago

^^ The newest change is at the top of the release history. It now describes the commit with the first 8 characters of the SHA and also the commit message.

/dcsil/dream-team/commit/28bcaaabd6c9b6b6b14d1c14dd6a981cf8b15612 This is an example of a commit URL, you can copy and post the first 8 characters of the SHA into the end of this and github will figure it out e.g. /dcsil/dream-team/commit/28bcaaab https://github.com/dcsil/dream-team/commit