From 7bf4fab1a4ca25e29c57f85b83a9aa006b3b8970 Mon Sep 17 00:00:00 2001 From: hyezis Date: Tue, 4 Jun 2024 06:08:56 +0900 Subject: [PATCH] chore: automate docker image --- .github/workflows/deploy-image.yaml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/deploy-image.yaml diff --git a/.github/workflows/deploy-image.yaml b/.github/workflows/deploy-image.yaml new file mode 100644 index 0000000..df890e9 --- /dev/null +++ b/.github/workflows/deploy-image.yaml @@ -0,0 +1,31 @@ +name: Build and Push Docker Image + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-push-iamge: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: "3" + + - name: Make venv + run: | + python -m venv venv + . venv/bin/activate + pip install -r requirements.txt + + - name: Build & Push Docker image + run: | + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + docker build -t ${{ secrets.DOCKER_USERNAME }}/msa-recommend . + docker push ${{ secrets.DOCKER_USERNAME }}/msa-recommend:latest