From b4f35a6d1ac1eb16df87f51e64770e5ea180b9e4 Mon Sep 17 00:00:00 2001 From: Eran Cohen Date: Tue, 16 Jun 2020 13:56:48 +0300 Subject: [PATCH] MGMT-1166 Added release.yaml to github workflow This workflow will build the repository container images upon git tag creation and publish it to ocpmetal registry with the matching tag --- .github/workflows/release.yaml | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..7beaeb6a --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,48 @@ +name: Build and push + +on: + push: + tags: + - "*" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v1 + - name: Install dependencies + uses: borales/actions-yarn@v2.0.0 + with: + cmd: install + - name: Call linter + uses: borales/actions-yarn@v2.0.0 + with: + cmd: lint + - name: Build code + uses: borales/actions-yarn@v2.0.0 + env: + NODE_OPTIONS: '--max-old-space-size=8192' + with: + cmd: build + - name: Get tag + id: get_tag + run: echo ::set-env name=GIT_TAG::${GITHUB_REF/refs\/tags\//} + - name: Publish to quay.io + uses: elgohr/Publish-Docker-Github-Action@2.14 + with: + name: ocpmetal/ocp-metal-ui + username: ${{ secrets.QUAYIO_OCPMETAL_USERNAME }} + password: ${{ secrets.QUAYIO_OCPMETAL_PASSWORD }} + registry: quay.io + dockerfile: Dockerfile + tags: '${{ env.GIT_TAG }},${{ github.sha }}' + - name: Publish integration tests to quay.io + uses: elgohr/Publish-Docker-Github-Action@2.14 + with: + name: ocpmetal/ocp-metal-ui-tests + username: ${{ secrets.QUAYIO_OCPMETAL_USERNAME }} + password: ${{ secrets.QUAYIO_OCPMETAL_PASSWORD }} + registry: quay.io + dockerfile: Dockerfile.cypress + tags: '${{ env.GIT_TAG }},${{ github.sha }}'