diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13fd9b5a..78a22817 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,11 @@ on: branches: ["main"] env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ github.token }} + +permissions: + contents: read + packages: write jobs: test-server: @@ -139,16 +143,31 @@ jobs: _build/logs/ retention-days: 7 - test-build-container: + test-build-image: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: docker/setup-docker-action@v4 + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + # Use the GITHUB_TOKEN secret provided by GitHub Actions + password: ${{ secrets.GITHUB_TOKEN }} + - name: GoGoGadgetDocker run: | sudo systemctl restart docker ./scripts/gogogadgetdocker.bash -s -t devel -a amd64 - exit $? + + docker tag ghcr.io/ethanrous/weblens:devel ghcr.io/ethanrous/weblens:devel-$GITHUB_HEAD_REF-$GITHUB_SHA + docker push ghcr.io/ethanrous/weblens:devel-$GITHUB_HEAD_REF-$GITHUB_SHA + + echo "Built and pushed image:" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "ghcr.io/ethanrous/weblens:devel-$GITHUB_HEAD_REF-$GITHUB_SHA" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY