Skip to content

Commit

Permalink
Update GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
textbook committed Mar 14, 2023
1 parent f832976 commit b1d4967
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/push.yml
Expand Up @@ -14,12 +14,11 @@ jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
id: nvmrc
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
id: setup-node
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run lint
Expand All @@ -31,27 +30,29 @@ jobs:
- uses: docker/build-push-action@v3
with:
build-args: |
NODE_RELEASE=${{ steps.nvmrc.outputs.NODE_VERSION }}
NODE_RELEASE=${NODE_VERSION#v}
load: true
push: false
tags: textbook/impasse
env:
NODE_VERSION: ${{ steps.setup-node.outputs.node-version }}
- run: npm run e2e:docker
deploy-docker:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
needs: build
steps:
- uses: actions/checkout@v2
- run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- uses: actions/checkout@v3
- run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvmrc
- name: Get full tag
id: full_tag
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Get major version
id: versions
run: |
echo ::set-output name=MAJOR::$(echo $VERSION | cut -d. -f1)
echo ::set-output name=MINOR::$(echo $VERSION | cut -d. -f2)
echo "MAJOR=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "MINOR=$(echo $VERSION | cut -d. -f2)" >> $GITHUB_OUTPUT
env:
VERSION: ${{ steps.full_tag.outputs.VERSION }}
- uses: docker/setup-buildx-action@v2
Expand All @@ -69,7 +70,7 @@ jobs:
textbook/impasse:${{ steps.full_tag.outputs.VERSION }}
textbook/impasse:${{ steps.versions.outputs.MAJOR }}
textbook/impasse:${{ steps.versions.outputs.MAJOR }}.${{ steps.versions.outputs.MINOR }}
- uses: peter-evans/dockerhub-description@v2
- uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand All @@ -79,8 +80,8 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
steps:
- uses: actions/checkout@v2
- uses: akhileshns/heroku-deploy@v3.6.8
- uses: actions/checkout@v3
- uses: akhileshns/heroku-deploy@v3.12.13
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: impasse
Expand Down

0 comments on commit b1d4967

Please sign in to comment.