From 4bb60a5e7984847f17f8d0c5972a7e4f8917727f Mon Sep 17 00:00:00 2001 From: osgeum <138707491+osgeum@users.noreply.github.com> Date: Thu, 1 Feb 2024 00:56:56 +0900 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a7a766a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,37 @@ +name: Push Docker Image to Docker Hub +on: + push: + branches: + - 'master' + tags: + - '**' +jobs: + push: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: osgeum/nodejs-ci + tag-semver: | + {{version}} + {{major}}.{{minor}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Build and push Docker Image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }}