From 6310a54ab944e8831afb9427e842910113e03c5a Mon Sep 17 00:00:00 2001 From: Wonshik KIM Date: Wed, 24 Apr 2024 02:15:23 +0900 Subject: [PATCH] ci: pipeline --- .github/workflows/pipeline.yml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/pipeline.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..90ff8fa --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,38 @@ +name: Build and Push Docker + +on: + release: + types: [created] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Write release version + run: | + VERSION=${{ github.event.release.tag_name }} + echo "VERSION=${VERSION:1}" >> $GITHUB_ENV + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/atmocube-metrics:${{ env.VERSION }} + ${{ secrets.DOCKERHUB_USERNAME }}/atmocube-metrics:latest + platforms: linux/arm64