From 7be1a43896d3e8b3a46b40c39ed71e874c968a26 Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Mon, 30 Mar 2020 18:45:25 +0200 Subject: [PATCH] ci: move env to top --- .github/workflows/build-and-release.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 1afa7bf..95e8fb8 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -2,6 +2,11 @@ name: Build and Release on: push +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GRAPHQL_API_ENDPOINT: ${{ secrets.GRAPHQL_API_ENDPOINT }} + GRAPHQL_API_KEY: ${{ secrets.GRAPHQL_API_KEY }} + jobs: main: runs-on: ubuntu-latest @@ -12,8 +17,7 @@ jobs: with: node-version: "12.x" - name: Authenticate with NPM - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > ~/.npmrc - name: Keep npm cache around to speed up installs @@ -33,15 +37,10 @@ jobs: cat .version - name: Build run: npm run build - env: - GRAPHQL_API_ENDPOINT: ${{ secrets.GRAPHQL_API_ENDPOINT }} - GRAPHQL_API_KEY: ${{ secrets.GRAPHQL_API_KEY }} - name: Lint run: npm run lint - name: Publish latest release to GitHub pages if: contains(github.ref, 'saga') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "machine github.com login authtoken password ${GITHUB_TOKEN}" > ~/.netrc git config --global user.email "actions@example.com" @@ -55,8 +54,6 @@ jobs: git push -f origin HEAD:gh-pages - name: Semantic release continue-on-error: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | npm i --no-save semantic-release npx semantic-release