From 17ecb7276a269db572a7cfc088892e75495e9ef9 Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Thu, 19 Mar 2020 15:13:05 +0100 Subject: [PATCH] Clean GH Actions workspace before each job GH Actions mounts docker volumes and executes the jobs from them. For some reason it doesn't clean these volumes automatically after each run. We assume that each run happens on a clean workspace and hence there are weird consequences when this assumption is broken. One of them, for example, is failure to publish documentation to GH Pages website. To publish such a documentation, we first add the website remote to the Dotty github repo. If the remote already exists, which is the case on a dirty workspace, we get an error. --- .github/workflows/ci.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bd0cddca3bd0..fdff0093542d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,6 +15,9 @@ jobs: container: akmetiuk/dotty:2020-02-12 steps: + - name: Clean Workspace + uses: anatoliykmetyuk/action-clean@1.0.2 + - name: Git Checkout uses: actions/checkout@v2 @@ -49,6 +52,9 @@ jobs: container: akmetiuk/dotty:2020-02-12 steps: + - name: Clean Workspace + uses: anatoliykmetyuk/action-clean@1.0.2 + - name: Git Checkout uses: actions/checkout@v2 @@ -83,6 +89,9 @@ jobs: container: akmetiuk/dotty:2020-02-12 steps: + - name: Clean Workspace + uses: anatoliykmetyuk/action-clean@1.0.2 + - name: Git Checkout uses: actions/checkout@v2 @@ -123,6 +132,9 @@ jobs: github.event_name == 'schedule' steps: + - name: Clean Workspace + uses: anatoliykmetyuk/action-clean@1.0.2 + - name: Git Checkout uses: actions/checkout@v2 @@ -160,6 +172,9 @@ jobs: github.event_name == 'schedule' steps: + - name: Clean Workspace + uses: anatoliykmetyuk/action-clean@1.0.2 + - name: Git Checkout uses: actions/checkout@v2 @@ -202,6 +217,9 @@ jobs: SONATYPE_USER: ${{ secrets.SONATYPE_USER }} steps: + - name: Clean Workspace + uses: anatoliykmetyuk/action-clean@1.0.2 + - name: Git Checkout uses: actions/checkout@v2 @@ -242,6 +260,9 @@ jobs: # Make sure you have the write permissions to the repo: https://github.com/lampepfl/dotty-website steps: + - name: Clean Workspace + uses: anatoliykmetyuk/action-clean@1.0.2 + - name: Git Checkout uses: actions/checkout@v2