From ccea583d96ef7e7499a9ac8818d361160e88db6f Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 26 Dec 2020 15:49:24 +0100 Subject: [PATCH] Use a more generic github workflow for pushing the docker image --- .github/workflows/push_image.yml | 25 +++++++++++++++++++++++++ .github/workflows/release.yml | 22 ---------------------- 2 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/push_image.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml new file mode 100644 index 0000000..db43200 --- /dev/null +++ b/.github/workflows/push_image.yml @@ -0,0 +1,25 @@ +name: Publish Docker Image +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Get release version + id: get_release_tag + run: | + echo ::set-env name=RELEASE_VERSION::$(echo $(date '+%Y%m%d')) + echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//" | tr '[:upper:]' '[:lower:]') + echo ::set-env name=REPOSITORY_OWNER::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@master + with: + name: ${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + snapshot: true + cache: true + tags: "latest, ${{ env.RELEASE_VERSION }}" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 612969e..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish Docker -on: - push: - branches: - - master -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Get release version - id: get_release_tag - run: echo ::set-env name=RELEASE_VERSION::$(echo $(date '+%Y%m%d')) - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: wiiuenv/wiiumodulesystem - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - snapshot: true - cache: true - tags: "latest, ${{ env.RELEASE_VERSION }}" \ No newline at end of file