|
| 1 | + |
| 2 | +name: build |
| 3 | +on: |
| 4 | + # for testing |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | + # production |
| 8 | + schedule: |
| 9 | + # # # - cron: '0 4 * * MON' |
| 10 | + - cron: '0 4 * * *' |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - main |
| 14 | +env: |
| 15 | + DEBUG_FLAG: ${{ true }} |
| 16 | + # DEBUG_FLAG: ${{ false }} |
| 17 | + RELEASE_DIR: "release" |
| 18 | + |
| 19 | +jobs: |
| 20 | + release: |
| 21 | + runs-on: ubuntu-18.04 |
| 22 | + steps: |
| 23 | + - name: Check Auth |
| 24 | + if: github.event_name == 'workflow_dispatch' && github.actor != 'ricardojosegomezulmke' && github.actor != '195858' |
| 25 | + run: | |
| 26 | + echo "not authorized" |
| 27 | + echo '::set-output name=IS_AUTHORIZED::false' |
| 28 | + id: auth |
| 29 | + - name: Cancel Workflow |
| 30 | + if: ${{ always() && steps.auth.outputs.IS_AUTHORIZED == 'false' }} |
| 31 | + |
| 32 | + |
| 33 | + - name: Checkout Current Branch |
| 34 | + uses: actions/checkout@v2 |
| 35 | + with: |
| 36 | + ref: ${{ github.ref }} |
| 37 | + |
| 38 | + - name: env before install |
| 39 | + if: env.DEBUG_FLAG == 'true' |
| 40 | + run: | |
| 41 | + echo "bash --version: "; bash --version |
| 42 | + echo "node --version: "; node --version |
| 43 | + echo "npm --version: "; npm --version |
| 44 | + echo ">>> environment: RELEASE_* " |
| 45 | + env | grep RELEASE |
| 46 | +
|
| 47 | + - uses: actions/setup-node@v2 |
| 48 | + with: |
| 49 | + node-version: '16.x' |
| 50 | + registry-url: 'https://registry.npmjs.org' |
| 51 | + |
| 52 | + - name: env after install |
| 53 | + if: env.DEBUG_FLAG == 'true' |
| 54 | + run: | |
| 55 | + echo "bash --version: "; bash --version |
| 56 | + echo "node --version: "; node --version |
| 57 | + echo "npm --version: "; npm --version |
| 58 | + echo "docker --version"; docker --version |
| 59 | + echo "docker-compose --version"; docker-compose --version |
| 60 | +
|
| 61 | + - uses: docker/login-action@v1 |
| 62 | + with: |
| 63 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 64 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 65 | + |
| 66 | + - name: Build |
| 67 | + run: | |
| 68 | + cd "$GITHUB_WORKSPACE/${RELEASE_DIR}" |
| 69 | + ./build.sh |
| 70 | +
|
| 71 | +### |
| 72 | +# The End. |
0 commit comments