diff --git a/.github/workflows/deploy.yml/Setup Java JDK b/.github/workflows/deploy.yml/Setup Java JDK new file mode 100644 index 00000000..a85ac114 --- /dev/null +++ b/.github/workflows/deploy.yml/Setup Java JDK @@ -0,0 +1,85 @@ +name: deploy +on: + push: + branches: + - deploy-staging + - deploy-production + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set staging variables + run: | + echo "ENVIRONMENT_URL=https://your_service.npm.red" >> $GITHUB_ENV + echo "DEPLOYMENT_CONFIDENCE_URL=${{ secrets.DATADOG_STAGING_DEPLOYMENT_DASHBOARD_URL }}" >> $GITHUB_ENV + if: github.ref == 'refs/heads/deploy-staging' + + - name: Set production variables + run: | + echo "ENVIRONMENT_URL=https://your_service.internal.npmjs.com" >> $GITHUB_ENV + echo "DEPLOYMENT_CONFIDENCE_URL=${{ secrets.DATADOG_PRODUCTION_DEPLOYMENT_DASHBOARD_URL }}" >> $GITHUB_ENV + if: github.ref == 'refs/heads/deploy-production' + + - name: create a deployment + uses: npm/action-deploy@v2 + with: + type: create + token: ${{github.token}} + logs: https://github.slack.com/archives/C02UYAZ5P # npm-deploys channel + environment_url: ${{env.ENVIRONMENT_URL}} + deployment_confidence_url: ${{env.DEPLOYMENT_CONFIDENCE_URL}} + job_status: ${{job.status}} # keep that to track status of the current job, when deployment is completed + slack_token: ${{secrets.NPM_ROBOT_SLACK_TOKEN}} + slack_channel: npm-ops + + # change to actual deployment steps + - name: placeholder for actual deployment + run: sleep 10s + - name: Setup Java JDK + + uses: actions/setup-java@v1.4.4 + + with: + + # The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28 + + java-version: + + # The package type (jre, jdk, jdk+fx) + + java-package: # optional, default is jdk + + # The architecture (x86, x64) of the package. + + architecture: # optional, default is x64 + + # Path to where the compressed JDK is located. The path could be in your source repository or a local path on the agent. + + jdkFile: # optional + + # ID of the distributionManagement repository in the pom.xml file. Default is `github` + + server-id: # optional, default is github + + # Environment variable name for the username for authentication to the Apache Maven repository. Default is $GITHUB_ACTOR + + server-username: # optional, default is GITHUB_ACTOR + + # Environment variable name for password or token for authentication to the Apache Maven repository. Default is $GITHUB_TOKEN + + server-password: # optional, default is GITHUB_TOKEN + + # Path to where the settings.xml file will be written. Default is ~/.m2. + + settings-path: # optional + + # GPG private key to import. Default is empty string. + + gpg-private-key: # optional + + # Environment variable name for the GPG private key passphrase. Default is $GPG_PASSPHRASE. + + gpg-passphrase: # optional