Update README.md #67
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: publish latest | |
| # Actions on the main branch for every change. | |
| # ----------------- | |
| # Control variables (GitHub Secrets) | |
| # ----------------- | |
| # | |
| # At the GitHub 'organisation' or 'project' level you must have the following | |
| # GitHub 'Secrets' defined (i.e. via 'Settings -> Secrets'): - | |
| # | |
| # DOCKERHUB_USERNAME | |
| # DOCKERHUB_TOKEN | |
| # | |
| # ----------- | |
| # Environment (GitHub Environments) | |
| # ----------- | |
| # | |
| # Environment (n/a) | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r build-requirements.txt | |
| - name: Lint | |
| run: yamllint . | |
| publish-latest: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v2 | |
| - name: Login to docker hub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Write image repo to env-file | |
| run: echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV | |
| - name: Publish latest to docker hub - ${{ env.IMAGE_NAME }} | |
| uses: docker/build-push-action@v2 | |
| with: | |
| push: true | |
| tags: ${{ env.IMAGE_REPOSITORY }}:latest |