Migrate admin endpoints and core Projects API #111
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy | |
| on: | |
| push: | |
| branches-ignore: ["*"] | |
| tags: ["*"] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'AWeber-Imbi/imbi' | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Get the version | |
| id: get_version | |
| run: echo "version=$(tr -d '\n' < api/VERSION)" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: pip install --upgrade setuptools twine packaging | |
| shell: bash | |
| - name: Build | |
| run: make dist | |
| - name: Upload to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: twine upload api/dist/imbi-${{ steps.get_version.outputs.version }}.tar.gz | |
| shell: bash | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push to hub.docker.com | |
| id: docker_build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| tags: aweber/imbi:${{ steps.get_version.outputs.version }} | |
| context: . | |
| file: ./Dockerfile | |
| build-args: | | |
| VERSION=${{ steps.get_version.outputs.version }} | |
| - name: Tag Latest | |
| run: | | |
| docker pull aweber/imbi:${{ steps.get_version.outputs.version }} | |
| docker tag aweber/imbi:${{ steps.get_version.outputs.version }} aweber/imbi:latest | |
| docker push aweber/imbi:latest |