aboutsummaryrefslogtreecommitdiff
path: root/.woodpecker.yml
blob: 15c5f96732c96652feb2da06b27e02774d89bc93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
steps:
  publish:
    image: alpine:edge
    environment:
      DOCKER_USER:
        from_secret: DOCKER_USER
      DOCKER_PASS:
        from_secret: DOCKER_PASS
      CBMAIL:
        from_secret: "mail"
      CBTOKEN:
        from_secret: "codeberg_token"
    commands:
      # Authenticate to Docker Hub so future pulls succeed
      - echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin

      # Install required packages
      - apk add --no-cache git curl bash

      # Run build script
      - cd website
      - chmod +x ./build.sh
      - ./build.sh

      # Configure git
      - git config --global user.email "$${CBMAIL}"
      - git config --global user.name "Woodpecker CI"

      # Push to pages branch
      - git clone -b pages https://$${CBTOKEN}@codeberg.org/$CI_REPO.git $CI_REPO_NAME
      - cd $CI_REPO_NAME
      - git rm -r "*" || true
      - cp -ar ../public/. ../.domains . || true
      - git add --all
      - git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" --allow-empty
      - git push
      - cd ..
      - rm -rf $CI_REPO_NAME

      # Push to core branch
      - git clone -b core https://$${CBTOKEN}@codeberg.org/$CI_REPO.git $CI_REPO_NAME
      - cd $CI_REPO_NAME
      - git rm -r "*" || true
      - cp -ar ../repos/core/. . || true
      - git add --all
      - git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" --allow-empty
      - git push
      - cd ..
      - rm -rf $CI_REPO_NAME

      # Push to extra branch
      - git clone -b extra https://$${CBTOKEN}@codeberg.org/$CI_REPO.git $CI_REPO_NAME
      - cd $CI_REPO_NAME
      - git rm -r "*" || true
      - cp -ar ../repos/extra/. . || true
      - git add --all
      - git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" --allow-empty
      - git push
      - cd ..
      - rm -rf $CI_REPO_NAME

    when:
      event: [push]