From a2f1df6c610ead84efd35d055a7e89bfbe108b9c Mon Sep 17 00:00:00 2001 From: Sakura Akeno Isayeki Date: Thu, 20 Jul 2023 18:00:58 +0200 Subject: [PATCH] ci: Add Docker build and push workflows for Minimap API - Added a new workflow file `minimap-api-build.yml` to build the Minimap API Docker image. - Added a new workflow file `minimap-api-push.yml` to push the Minimap API Docker image to DockerHub and GHCR. - Deleted the old workflow file `minimap-main.yml` which was used for CI testing. These changes enable automated building and pushing of the Minimap API Docker image. --- .github/workflows/minimap-api-build.yml | 18 +++++++ .github/workflows/minimap-api-push.yml | 34 ++++++++++++ .github/workflows/minimap-main.yml | 71 ------------------------- 3 files changed, 52 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/minimap-api-build.yml create mode 100644 .github/workflows/minimap-api-push.yml delete mode 100644 .github/workflows/minimap-main.yml diff --git a/.github/workflows/minimap-api-build.yml b/.github/workflows/minimap-api-build.yml new file mode 100644 index 00000000..88cfddda --- /dev/null +++ b/.github/workflows/minimap-api-build.yml @@ -0,0 +1,18 @@ +name: Build Minimap API Docker Image + +on: + push: + paths: + - 'wowskarma_api_minimap/**' + workflow_dispatch: + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Build Docker Image + run: docker build -f wowskarma_api_minimap/Dockerfile.dev -t wowskarma_api_minimap:tag . \ No newline at end of file diff --git a/.github/workflows/minimap-api-push.yml b/.github/workflows/minimap-api-push.yml new file mode 100644 index 00000000..f2327888 --- /dev/null +++ b/.github/workflows/minimap-api-push.yml @@ -0,0 +1,34 @@ +name: Push Minimap API Docker Image + +on: + workflow_dispatch: + push: + branches: [ main ] + +jobs: + release_dockerhub: + runs-on: ubuntu-latest + steps: + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Push to DockerHub + run: docker push wowskarma_api_minimap:tag + + release_ghcr: + runs-on: ubuntu-latest + steps: + - name: Login to GHCR + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push to GHCR + run: | + docker tag wowskarma_api_minimap:tag ghcr.io/${{ github.repository }}/wowskarma_api_minimap:tag + docker push ghcr.io/${{ github.repository }}/wowskarma_api_minimap:tag \ No newline at end of file diff --git a/.github/workflows/minimap-main.yml b/.github/workflows/minimap-main.yml deleted file mode 100644 index b0d43535..00000000 --- a/.github/workflows/minimap-main.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Minimap API - CI - -on: - # Triggers the workflow on push or pull request events but only for the main or develop branch - push: - branches: - - main - - develop - pull_request: - branches: - - main - - develop - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - linter: - strategy: - fail-fast: false - matrix: - python-version: ["3.10"] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Change directory to subdirectory - run: cd wowskarma_api_minimap - - name: Install project dependencies - run: make install - - name: Run linter - run: make lint - - tests_linux: - needs: linter - strategy: - fail-fast: false - matrix: - python-version: ["3.10"] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install project - run: make install - # with: - # fail_ci_if_error: true - - tests_win: - needs: linter - strategy: - fail-fast: false - matrix: - python-version: [3.10] - os: [windows-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install Pip - run: pip install --user --upgrade pip - - name: Install project - run: pip install -e wowskarma.minimap.api/.