From 0583f0fd6329b3345f2463382f78fad188315d91 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Nakazone Batista Date: Mon, 5 Sep 2022 03:44:50 -0300 Subject: [PATCH] Create docker-publish.yml --- .github/workflows/docker-publish.yml | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..6ed460f --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,55 @@ +name: ci + +on: + push: + branches: + - 'main' + +jobs: + + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + env: + PORT: '5000' + BACKEND_PATH: 'unsecure' + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + + docker: + + + needs: [build] + runs-on: ubuntu-latest + steps: + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + push: true + tags: yoshiunfriendly/frontend-hideyoshi.com:latest