fix: gluetun port request #12
This file contains 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 Docker Image to GHCR | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Log in to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and tag Docker image | |
run: | | |
docker build -t intermediate:latest . | |
- name: Install Slim Toolkit | |
run: | | |
wget https://github.com/slimtoolkit/slim/releases/download/1.40.11/dist_linux.tar.gz | |
tar -xzf dist_linux.tar.gz | |
sudo cp dist_linux/* /usr/local/bin/ | |
- name: Slim Docker image | |
run: | | |
docker-slim build --http-probe=false --continue-after=30 --tag "ghcr.io/${{ github.repository }}:latest" --target "intermediate:latest" | |
- name: Push Docker image to GHCR | |
run: | | |
docker push ghcr.io/${{ github.repository }}:latest |