From 9832deb20cda87c498415c0ff86eb4a371113aab Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 2 Sep 2021 16:05:17 -0400 Subject: [PATCH] Update workflows with linter suggestions (#1174) --- .github/workflows/build.yml | 18 +++++++++--------- .github/workflows/crowdin-sync.yml | 5 +++-- .github/workflows/deploy.yml | 6 +++--- .github/workflows/qa-deploy.yml | 7 ++++--- .github/workflows/release.yml | 13 ++++++++----- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fb13338ca..ad1927e57e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,4 @@ +--- name: Build on: @@ -43,7 +44,7 @@ jobs: - name: Cache npm id: npm-cache - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 with: path: '~/.npm' key: ${{ runner.os }}-${{ github.run_id }}-npm-${{ hashFiles('**/package-lock.json') }} @@ -70,7 +71,7 @@ jobs: uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403 with: keyvault: "bitwarden-prod-kv" - secrets: "docker-password, + secrets: "docker-password, docker-username, dct-delegate-2-repo-passphrase, dct-delegate-2-key" @@ -127,14 +128,14 @@ jobs: - name: Push rc images if: github.ref == 'refs/heads/rc' run: docker push bitwarden/web:rc - env: + env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-repo-passphrase }} - name: Push dev images if: github.ref == 'refs/heads/master' run: docker push bitwarden/web:dev - env: + env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-repo-passphrase }} @@ -158,7 +159,7 @@ jobs: - name: Cache npm id: npm-cache - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 with: path: '~/.npm' key: ${{ runner.os }}-${{ github.run_id }}-npm-${{ hashFiles('**/package-lock.json') }} @@ -209,7 +210,7 @@ jobs: if [[ $TAG_EXTENSION ]]; then IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION - fi + fi echo "::set-output name=value::$IMAGE_TAG" - name: Tag image @@ -274,9 +275,8 @@ jobs: - name: Checkout repo uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - - name: npm install + - name: NPM install run: npm install - - name: npm build + - name: NPM build run: npm run build:cloud - diff --git a/.github/workflows/crowdin-sync.yml b/.github/workflows/crowdin-sync.yml index b55f832a9d..ef9dec94f9 100644 --- a/.github/workflows/crowdin-sync.yml +++ b/.github/workflows/crowdin-sync.yml @@ -1,10 +1,11 @@ +--- name: Crowdin Sync on: workflow_dispatch: inputs: {} - #schedule: - # - cron: '0 0 * * *' +# schedule: +# - cron: '0 0 * * *' jobs: crowdin-sync: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9b0a9b564b..95dd9242a4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,7 @@ +--- name: Deploy -on: +on: workflow_dispatch: inputs: release_version: @@ -40,7 +41,7 @@ jobs: with: ref: rc - - name: setup git config + - name: Setup git config run: | git config user.name = "GitHub Action Bot" git config user.email = "<>" @@ -70,4 +71,3 @@ jobs: VERSION: ${{ steps.release-version.outputs.version }} PR_BRANCH: deploy-${{ steps.release-version.outputs.version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/qa-deploy.yml b/.github/workflows/qa-deploy.yml index 9f826a61e4..48a8f2ac92 100644 --- a/.github/workflows/qa-deploy.yml +++ b/.github/workflows/qa-deploy.yml @@ -1,6 +1,7 @@ +--- name: QA Deploy -on: +on: workflow_dispatch: inputs: image_extension: @@ -19,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Setup run: @@ -59,7 +60,7 @@ jobs: if [[ $TAG_EXTENSION ]]; then IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION - fi + fi echo "::set-output name=value::$IMAGE_TAG" - name: Deploy Web image diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c763f4c21b..974e6db6b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,4 @@ +--- name: Release on: @@ -9,6 +10,7 @@ on: jobs: setup: + name: Setup runs-on: ubuntu-latest outputs: release_upload_url: ${{ steps.create_release.outputs.upload_url }} @@ -62,10 +64,11 @@ jobs: prerelease: false ubuntu: + name: Ubuntu runs-on: ubuntu-latest needs: setup env: - RELEASE_VERSION: ${{ needs.setup.outputs.release_version }} + _RELEASE_VERSION: ${{ needs.setup.outputs.release_version }} steps: - name: Set up Node uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea @@ -96,7 +99,7 @@ jobs: uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403 with: keyvault: "bitwarden-prod-kv" - secrets: "docker-password, + secrets: "docker-password, docker-username, dct-delegate-2-repo-passphrase, dct-delegate-2-key" @@ -136,19 +139,19 @@ jobs: docker build -t bitwarden/web . - name: Tag version - run: docker tag bitwarden/web bitwarden/web:$RELEASE_VERSION + run: docker tag bitwarden/web bitwarden/web:$_RELEASE_VERSION - name: List Docker images run: docker images - name: Push latest images run: docker push bitwarden/web:latest - env: + env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-repo-passphrase }} - name: Push version images - run: docker push bitwarden/web:$RELEASE_VERSION + run: docker push bitwarden/web:$_RELEASE_VERSION env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-repo-passphrase }}