From 669e8d57c352d666f0d97cc43d5d694c34853909 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 4 Feb 2024 12:21:17 -0300 Subject: [PATCH] Added GitHub workflow to deploy Docker Images into GitHub Packages --- .github/workflows/deploy.yml | 22 ++++++++++++++++++++++ build.sh | 2 +- recipes/synthesis | 5 +++-- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8ddd457 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,22 @@ +name: Deploy Docker Images + +on: [push] + +jobs: + synthesis: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build Docker image + run: docker build -f recipes/synthesis -t ghcr.io/pyfpga/synthesis . + - name: Push Docker image + run: docker push ghcr.io/pyfpga/synthesis diff --git a/build.sh b/build.sh index b050d3b..669fdb4 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/bash set -e IMAGE=$1 -docker build -f recipes/$IMAGE -t pyfpga/$IMAGE . +docker build -f recipes/$IMAGE -t ghcr.io/pyfpga/$IMAGE . diff --git a/recipes/synthesis b/recipes/synthesis index 9087d72..cfcff55 100644 --- a/recipes/synthesis +++ b/recipes/synthesis @@ -33,6 +33,8 @@ RUN apt update -qq \ jq \ tar \ wget \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb \ + && apt clean \ && update-ca-certificates ############################################################################### @@ -80,6 +82,5 @@ RUN mkdir synlig && cd synlig \ # Clean ############################################################################### -RUN apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/apt/archives/*.deb \ +RUN rm -rf /tmp/* /var/tmp/* \ && rm -fr /root/ghdl /root/yosys /root/ghdl-yosys-plugin /root/synlig