diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 0000000..723af8c --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,54 @@ +name: Build Docker Image-ubuntu + +on: + push: + branches: + - develop + - Docker_workflow + pull_request: + branches: + - develop + - Docker_workflow + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Build Docker image + run: | + ls + pushd Docker + docker build -f Dockerfile.flint.ubuntu.18.04 -t moja/flint:ubuntu-18.04 . + popd + + - name: Save Docker image as artifact + run: | + docker save moja/flint:ubuntu-18.04 | gzip > flint_docker_image.tar.gz + shell: bash + + - name: Upload Docker image artifact + uses: actions/upload-artifact@v2 + with: + name: docker-image + path: flint_docker_image.tar.gz