Skip to content

Commit

Permalink
Removing crtaes.io and DockerHub publication
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Rhod committed Jun 13, 2023
1 parent 595de8a commit c9b30a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 68 deletions.
87 changes: 21 additions & 66 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ jobs:
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'
clippy:
name: Clippy check
runs-on: ubuntu-latest
container: kisiodigital/rust-ci:latest-proj8.1.0
needs: aws_creds
runs-on: [self-hosted, dataeng, sandbox]
container:
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.0
credentials:
username: AWS
password: ${{ needs.aws_creds.outputs.token }}
steps:
- uses: actions/checkout@v3
- name: Lint
Expand All @@ -68,8 +73,13 @@ jobs:
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'
audit:
name: Security audit
runs-on: ubuntu-latest
container: kisiodigital/rust-ci:latest-proj8.1.0
needs: aws_creds
runs-on: [self-hosted, dataeng, sandbox]
container:
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.0
credentials:
username: AWS
password: ${{ needs.aws_creds.outputs.token }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
Expand All @@ -87,8 +97,13 @@ jobs:
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'
tests:
name: Tests
runs-on: ubuntu-latest
container: kisiodigital/rust-ci:latest-proj8.1.0
needs: aws_creds
runs-on: [self-hosted, dataeng, sandbox]
container:
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.0
credentials:
username: AWS
password: ${{ needs.aws_creds.outputs.token }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
Expand Down Expand Up @@ -140,63 +155,3 @@ jobs:
"pretext": "`transit_model Publish` requires your attention",
"text":" :warning: Publish on AWS failed","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'

dockerhub:
name: Dockerhub publication
needs: [build-n-push]
if: github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v3
- name: Build image
run: |
docker build . --file Dockerfile --tag $IMAGE_ID
- name: Tag image
if: github.event_name == 'release'
run: |
VERSION="v$( grep "^version =" Cargo.toml | tr -cd '[:digit:].' )"
docker tag $IMAGE_ID $IMAGE_ID:$VERSION
- name: Log into registry
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login $DOCKER_REGISTRY_URL --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Push image
run: |
docker image push --all-tags $IMAGE_ID
- name: Failure Slack notif
if: failure()
run: |
curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }}
env:
SLACK_TEXT: '{"attachments":[{
"pretext": "`transit_model Publish` requires your attention",
"text":" :warning: Publish failed","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'
cratesio:
name: Crates.io publication
needs: [dockerhub]
if: github.event_name == 'release'
runs-on: ubuntu-latest
container: kisiodigital/rust-ci:latest-proj8.1.0
steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v3
- name: Cargo login
uses: actions-rs/cargo@v1
with:
command: login
args: -- ${{ secrets.CARGO_TOKEN }}
- name: Publish
uses: actions-rs/cargo@v1
with:
command: publish
args: --all-features
- name: Failure Slack notif
if: failure()
run: |
curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }}
env:
SLACK_TEXT: '{"attachments":[{
"pretext": "`transit_model Publish` requires your attention",
"text":" :warning: Publish failed","color":"#D00000",
"fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}'
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM kisiodigital/rust-ci:latest-proj8.1.0 as builder
FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-proj-ci:latest-proj8.1.0 as builder
WORKDIR /usr/src/app
COPY . ./
RUN git describe --tags --always && git status
RUN cargo build --workspace --release
RUN mkdir /usr/src/bin && for file in ls ${CARGO_TARGET_DIR:-./target}/release/*; do if test -f $file -a -x $file; then cp $file /usr/src/bin; fi; done

FROM kisiodigital/proj-ci:8.1.0
FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-proj-ci:8.1.0
COPY --from=builder /usr/src/bin/* /usr/local/bin/

0 comments on commit c9b30a8

Please sign in to comment.