Skip to content

readme: add readme and docker builds to docker hub #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') == true
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: l3uddz/nabarr/nabarr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: cloudb0x/nabarr
dockerfile: docker/Dockerfile
tags: latest
tag_with_ref: true
Expand All @@ -105,12 +104,12 @@ jobs:
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: l3uddz/nabarr/nabarr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: cloudb0x/nabarr
dockerfile: docker/Dockerfile
tags: master
tag_with_ref: false
tag_with_sha: false
always_pull: true

Expand All @@ -119,10 +118,9 @@ jobs:
if: startsWith(github.ref, 'refs/heads/master') == false
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: l3uddz/nabarr/nabarr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: cloudb0x/nabarr
dockerfile: docker/Dockerfile
tag_with_ref: true
tag_with_sha: false
Expand Down
42 changes: 7 additions & 35 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,11 @@ jobs:
replace-with: '-'
flags: 'g'

- name: query for package version id
uses: octokit/[email protected]
id: query_package_version
with:
query: |
query package($owner:String!,$repo:String!,$tag:String!) {
repository(owner: $owner, name: $repo) {
packages(names:[$repo], first:1) {
edges {
node {
id,
name,
version(version: $tag) {
id, version
}
}
}
}
}
}
owner: l3uddz
repo: ${{ github.event.repository.name }}
tag: ${{ steps.dockertag.outputs.replaced }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: parse package version id
id: package_version
run: echo "VERSION_ID=$(echo $json | jq -r $jsonpath)" >> $GITHUB_ENV
- name: Remove branch docker tag
shell: bash
env:
json: ${{ steps.query_package_version.outputs.data }}
jsonpath: ".repository.packages.edges[].node.version.id"

- uses: actions/delete-package-versions@v1
with:
package-version-ids: '${{ env.VERSION_ID }}'
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag: ${{ steps.dockertag.outputs.replaced }}
run: |
docker run --rm lumir/remove-dockerhub-tag --user "$username" --password "$password" cloudb0x/nabarr:$tag
Loading